mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-05-03 22:56:49 +00:00
fix(ChatModel): compute correctly composing when chat room is set
This commit is contained in:
parent
29c5342ce1
commit
a292d0ef0d
2 changed files with 13 additions and 7 deletions
|
|
@ -282,6 +282,7 @@ void ChatModel::setSipAddress (const QString &sipAddress) {
|
||||||
shared_ptr<linphone::Core> core = CoreManager::getInstance()->getCore();
|
shared_ptr<linphone::Core> core = CoreManager::getInstance()->getCore();
|
||||||
|
|
||||||
mChatRoom = core->getChatRoomFromUri(::Utils::appStringToCoreString(sipAddress));
|
mChatRoom = core->getChatRoomFromUri(::Utils::appStringToCoreString(sipAddress));
|
||||||
|
updateIsRemoteComposing();
|
||||||
|
|
||||||
if (mChatRoom->getUnreadMessagesCount() > 0)
|
if (mChatRoom->getUnreadMessagesCount() > 0)
|
||||||
resetMessagesCount();
|
resetMessagesCount();
|
||||||
|
|
@ -649,6 +650,14 @@ void ChatModel::resetMessagesCount () {
|
||||||
emit messagesCountReset();
|
emit messagesCountReset();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ChatModel::updateIsRemoteComposing () {
|
||||||
|
bool isRemoteComposing = mChatRoom->isRemoteComposing();
|
||||||
|
if (isRemoteComposing != mIsRemoteComposing) {
|
||||||
|
mIsRemoteComposing = isRemoteComposing;
|
||||||
|
emit isRemoteComposingChanged(mIsRemoteComposing);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
void ChatModel::handleCallStateChanged (const shared_ptr<linphone::Call> &call, linphone::CallState state) {
|
void ChatModel::handleCallStateChanged (const shared_ptr<linphone::Call> &call, linphone::CallState state) {
|
||||||
|
|
@ -660,13 +669,8 @@ void ChatModel::handleCallStateChanged (const shared_ptr<linphone::Call> &call,
|
||||||
}
|
}
|
||||||
|
|
||||||
void ChatModel::handleIsComposingChanged (const shared_ptr<linphone::ChatRoom> &chatRoom) {
|
void ChatModel::handleIsComposingChanged (const shared_ptr<linphone::ChatRoom> &chatRoom) {
|
||||||
if (mChatRoom == chatRoom) {
|
if (mChatRoom == chatRoom)
|
||||||
bool isRemoteComposing = mChatRoom->isRemoteComposing();
|
updateIsRemoteComposing();
|
||||||
if (isRemoteComposing != mIsRemoteComposing) {
|
|
||||||
mIsRemoteComposing = isRemoteComposing;
|
|
||||||
emit isRemoteComposingChanged(mIsRemoteComposing);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ChatModel::handleMessageReceived (const shared_ptr<linphone::ChatMessage> &message) {
|
void ChatModel::handleMessageReceived (const shared_ptr<linphone::ChatMessage> &message) {
|
||||||
|
|
|
||||||
|
|
@ -137,6 +137,8 @@ private:
|
||||||
|
|
||||||
void resetMessagesCount ();
|
void resetMessagesCount ();
|
||||||
|
|
||||||
|
void updateIsRemoteComposing ();
|
||||||
|
|
||||||
void handleCallStateChanged (const std::shared_ptr<linphone::Call> &call, linphone::CallState state);
|
void handleCallStateChanged (const std::shared_ptr<linphone::Call> &call, linphone::CallState state);
|
||||||
void handleIsComposingChanged (const std::shared_ptr<linphone::ChatRoom> &chatRoom);
|
void handleIsComposingChanged (const std::shared_ptr<linphone::ChatRoom> &chatRoom);
|
||||||
void handleMessageReceived (const std::shared_ptr<linphone::ChatMessage> &message);
|
void handleMessageReceived (const std::shared_ptr<linphone::ChatMessage> &message);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue