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
8fedfb58
Commit
8fedfb58
authored
Apr 12, 2017
by
Ronan Abhamon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(src/components/chat/ChatModel): handle correctly call state
parent
71b04c5e
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
24 additions
and
22 deletions
+24
-22
ChatModel.cpp
linphone-desktop/src/components/chat/ChatModel.cpp
+18
-19
ChatModel.hpp
linphone-desktop/src/components/chat/ChatModel.hpp
+3
-0
bctoolbox
submodules/bctoolbox
+1
-1
bzrtp
submodules/bzrtp
+1
-1
linphone
submodules/linphone
+1
-1
No files found.
linphone-desktop/src/components/chat/ChatModel.cpp
View file @
8fedfb58
...
...
@@ -176,25 +176,8 @@ ChatModel::ChatModel (QObject *parent) : QAbstractListModel(parent) {
core
->
getSipAddressesModel
()
->
connectToChatModel
(
this
);
QObject
::
connect
(
&
(
*
m_core_handlers
),
&
CoreHandlers
::
messageReceived
,
this
,
[
this
](
const
shared_ptr
<
linphone
::
ChatMessage
>
&
message
)
{
if
(
m_chat_room
==
message
->
getChatRoom
())
{
insertMessageAtEnd
(
message
);
resetMessagesCount
();
emit
messageReceived
(
message
);
}
}
);
QObject
::
connect
(
&
(
*
m_core_handlers
),
&
CoreHandlers
::
callStateChanged
,
this
,
[
this
](
const
std
::
shared_ptr
<
linphone
::
Call
>
&
call
,
linphone
::
CallState
state
)
{
if
(
state
==
linphone
::
CallStateEnd
||
state
==
linphone
::
CallStateError
)
insertCall
(
call
->
getCallLog
());
}
);
QObject
::
connect
(
&
(
*
m_core_handlers
),
&
CoreHandlers
::
messageReceived
,
this
,
&
ChatModel
::
handleMessageReceived
);
QObject
::
connect
(
&
(
*
m_core_handlers
),
&
CoreHandlers
::
callStateChanged
,
this
,
&
ChatModel
::
handleCallStateChanged
);
}
ChatModel
::~
ChatModel
()
{
...
...
@@ -580,3 +563,19 @@ void ChatModel::resetMessagesCount () {
m_chat_room
->
markAsRead
();
emit
messagesCountReset
();
}
// -----------------------------------------------------------------------------
void
ChatModel
::
handleCallStateChanged
(
const
std
::
shared_ptr
<
linphone
::
Call
>
&
call
,
linphone
::
CallState
state
)
{
if
(
m_chat_room
==
call
->
getChatRoom
()
&&
(
state
==
linphone
::
CallStateEnd
||
state
==
linphone
::
CallStateError
))
insertCall
(
call
->
getCallLog
());
}
void
ChatModel
::
handleMessageReceived
(
const
std
::
shared_ptr
<
linphone
::
ChatMessage
>
&
message
)
{
if
(
m_chat_room
==
message
->
getChatRoom
())
{
insertMessageAtEnd
(
message
);
resetMessagesCount
();
emit
messageReceived
(
message
);
}
}
linphone-desktop/src/components/chat/ChatModel.hpp
View file @
8fedfb58
...
...
@@ -122,6 +122,9 @@ private:
void
resetMessagesCount
();
void
handleCallStateChanged
(
const
std
::
shared_ptr
<
linphone
::
Call
>
&
call
,
linphone
::
CallState
state
);
void
handleMessageReceived
(
const
std
::
shared_ptr
<
linphone
::
ChatMessage
>
&
message
);
QList
<
ChatEntryData
>
m_entries
;
std
::
shared_ptr
<
linphone
::
ChatRoom
>
m_chat_room
;
...
...
bctoolbox
@
e93227f5
Subproject commit
cb6314384fd108ce206e1467e9c253bc8cddd161
Subproject commit
e93227f56dc0c2299de20ac1460bfdb72e8e695b
bzrtp
@
4c37a23c
Subproject commit
b64ed01b6d7a276fb39d3692ec9e737048135805
Subproject commit
4c37a23c805e7f08c8874d848525a720c165c906
linphone
@
15bc3050
Subproject commit
cca2555ca61485dc6ba4cdfb9a5cb17d48665049
Subproject commit
15bc305047eacfc9ff7f8c733bdeef21b0a5842c
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