mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-05-07 05:53:06 +00:00
little fixes
This commit is contained in:
parent
3c70511b7d
commit
0684ac4649
4 changed files with 30 additions and 27 deletions
|
|
@ -213,12 +213,13 @@ static string buildSqlEventFilter (const list<EventsDb::Filter> &filters, Events
|
|||
int EventsDb::getMessagesCount (const string &remoteAddress) const {
|
||||
L_D(const EventsDb);
|
||||
|
||||
string query = "SELECT COUNT(*) FROM message_event"
|
||||
" WHERE dialog_id = ("
|
||||
" SELECT id FROM dialog WHERE remote_sip_address_id =("
|
||||
" SELECT id FROM sip_address WHERE value = :remote_address"
|
||||
" )"
|
||||
" )", use(remoteAddress);
|
||||
string query = "SELECT COUNT(*) FROM message_event";
|
||||
if (!remoteAddress.empty())
|
||||
query += " WHERE dialog_id = ("
|
||||
" SELECT id FROM dialog WHERE remote_sip_address_id =("
|
||||
" SELECT id FROM sip_address WHERE value = :remote_address"
|
||||
" )"
|
||||
" )", soci::use(remoteAddress);
|
||||
int count = 0;
|
||||
|
||||
L_BEGIN_LOG_EXCEPTION
|
||||
|
|
|
|||
16
src/enums.h
16
src/enums.h
|
|
@ -25,21 +25,7 @@
|
|||
|
||||
LINPHONE_BEGIN_NAMESPACE
|
||||
|
||||
enum class MessageDirection {
|
||||
Incoming,
|
||||
Outgoing
|
||||
};
|
||||
|
||||
enum class MessageState {
|
||||
Idle,
|
||||
InProgress,
|
||||
Delivered,
|
||||
NotDelivered,
|
||||
FileTransferError,
|
||||
FileTransferDone,
|
||||
DeliveredToUser,
|
||||
Displayed
|
||||
};
|
||||
// Nothing. for the moment.
|
||||
|
||||
LINPHONE_END_NAMESPACE
|
||||
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ using namespace std;
|
|||
class MessagePrivate : public ObjectPrivate {
|
||||
private:
|
||||
weak_ptr<ChatRoom> chatRoom;
|
||||
MessageDirection direction = MessageDirection::Incoming;
|
||||
Message::Direction direction = Message::Incoming;
|
||||
// LinphoneAddress *from;
|
||||
// LinphoneAddress *to;
|
||||
shared_ptr<ErrorInfo> errorInfo;
|
||||
|
|
@ -44,7 +44,7 @@ private:
|
|||
string appData;
|
||||
list<shared_ptr<Content> > contents;
|
||||
unordered_map<string, string> customHeaders;
|
||||
MessageState state = MessageState::Idle;
|
||||
Message::State state = Message::Idle;
|
||||
shared_ptr<EventsDb> eventsDb;
|
||||
|
||||
L_DECLARE_PUBLIC(Message);
|
||||
|
|
@ -63,7 +63,7 @@ shared_ptr<ChatRoom> Message::getChatRoom () const {
|
|||
return chatRoom;
|
||||
}
|
||||
|
||||
MessageDirection Message::getDirection () const {
|
||||
Message::Direction Message::getDirection () const {
|
||||
L_D(const Message);
|
||||
return d->direction;
|
||||
}
|
||||
|
|
@ -88,7 +88,7 @@ shared_ptr<const Address> Message::getRemoteAddress () const {
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
MessageState Message::getState () const {
|
||||
Message::State Message::getState () const {
|
||||
L_D(const Message);
|
||||
return d->state;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,16 +40,32 @@ class LINPHONE_PUBLIC Message : public Object {
|
|||
friend class ChatRoom;
|
||||
|
||||
public:
|
||||
enum Direction {
|
||||
Incoming,
|
||||
Outgoing
|
||||
};
|
||||
|
||||
enum State {
|
||||
Idle,
|
||||
InProgress,
|
||||
Delivered,
|
||||
NotDelivered,
|
||||
FileTransferError,
|
||||
FileTransferDone,
|
||||
DeliveredToUser,
|
||||
Displayed
|
||||
};
|
||||
|
||||
std::shared_ptr<ChatRoom> getChatRoom () const;
|
||||
|
||||
MessageDirection getDirection () const;
|
||||
Direction getDirection () const;
|
||||
|
||||
std::shared_ptr<const Address> getFromAddress () const;
|
||||
std::shared_ptr<const Address> getToAddress () const;
|
||||
std::shared_ptr<const Address> getLocalAddress () const;
|
||||
std::shared_ptr<const Address> getRemoteAddress () const;
|
||||
|
||||
MessageState getState () const;
|
||||
State getState () const;
|
||||
|
||||
std::shared_ptr<const ErrorInfo> getErrorInfo () const;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue