Commit 0684ac46 authored by Ronan's avatar Ronan
Browse files

little fixes

parent 3c70511b
......@@ -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
......
......@@ -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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment