fix(ChatRoom): mark as read correctly chat message

This commit is contained in:
Ronan Abhamon 2017-11-08 17:51:38 +01:00
parent 5c857c2db1
commit 987fca9499
2 changed files with 6 additions and 10 deletions

View file

@ -228,7 +228,7 @@ void ChatRoomPrivate::storeOrUpdateMessage (const shared_ptr<ChatMessage> &msg)
void ChatRoomPrivate::sendMessage (const shared_ptr<ChatMessage> &msg) {
L_Q();
msg->getPrivate()->setDirection(ChatMessage::Direction::Outgoing);
/* Add to transient list */
@ -556,6 +556,11 @@ void ChatRoom::markAsRead () {
chatMessage->sendDisplayNotification();
dCore->mainDb->markChatMessagesAsRead(peerAddress);
if (d->pendingMessage) {
d->pendingMessage->updateState(ChatMessage::State::Displayed);
d->pendingMessage->sendDisplayNotification();
}
}
// -----------------------------------------------------------------------------

View file

@ -129,15 +129,6 @@ LinphoneCall *RealTimeTextChatRoom::getCall () const {
return d->call;
}
void RealTimeTextChatRoom::markAsRead () {
L_D();
ChatRoom::markAsRead();
if (d->pendingMessage) {
d->pendingMessage->updateState(ChatMessage::State::Displayed);
d->pendingMessage->sendDisplayNotification();
}
}
// -----------------------------------------------------------------------------
void RealTimeTextChatRoom::onChatMessageReceived(const shared_ptr<ChatMessage> &msg) {}