Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linphone-desktop
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
linphone-desktop
Commits
a292d0ef
Commit
a292d0ef
authored
Jun 26, 2017
by
Wescoeur
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(ChatModel): compute correctly composing when chat room is set
parent
29c5342c
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
7 deletions
+13
-7
ChatModel.cpp
src/components/chat/ChatModel.cpp
+11
-7
ChatModel.hpp
src/components/chat/ChatModel.hpp
+2
-0
No files found.
src/components/chat/ChatModel.cpp
View file @
a292d0ef
...
@@ -282,6 +282,7 @@ void ChatModel::setSipAddress (const QString &sipAddress) {
...
@@ -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 () {
...
@@ -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,
...
@@ -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
)
{
...
...
src/components/chat/ChatModel.hpp
View file @
a292d0ef
...
@@ -137,6 +137,8 @@ private:
...
@@ -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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment