diff --git a/linphone-app/src/components/chat-room/ChatRoomModel.hpp b/linphone-app/src/components/chat-room/ChatRoomModel.hpp index b99277650..81c62ceb5 100644 --- a/linphone-app/src/components/chat-room/ChatRoomModel.hpp +++ b/linphone-app/src/components/chat-room/ChatRoomModel.hpp @@ -233,7 +233,7 @@ public: void sendFileMessage (const QString &path); Q_INVOKABLE void forwardMessage(ChatMessageModel * model); void compose (); - void resetMessageCount (); + Q_INVOKABLE void resetMessageCount (); Q_INVOKABLE void initEntries(); Q_INVOKABLE int loadMoreEntries(); // return new entries count void callEnded(std::shared_ptr call); diff --git a/linphone-app/ui/modules/Linphone/Chat/Chat.qml b/linphone-app/ui/modules/Linphone/Chat/Chat.qml index fa686cf7d..87e1bc67f 100644 --- a/linphone-app/ui/modules/Linphone/Chat/Chat.qml +++ b/linphone-app/ui/modules/Linphone/Chat/Chat.qml @@ -52,6 +52,16 @@ Rectangle { if( loadingEntries && !displaying) displaying = true } + onBindToEndChanged: if( bindToEnd){ + markAsReadTimer.start() + } + Timer{ + id: markAsReadTimer + interval: 5000 + repeat: false + running: false + onTriggered: container.proxyModel.chatRoomModel.resetMessageCount() + } //property var sipAddressObserver: SipAddressesModel.getSipAddressObserver(proxyModel.fullPeerAddress, proxyModel.fullLocalAddress) // ----------------------------------------------------------------------- Layout.fillHeight: true