Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
BC
public
liblinphone
Commits
735268f8
Commit
735268f8
authored
Jun 20, 2017
by
Ghislain MARY
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix last received chat message not being marked as read.
parent
8517a2d0
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
0 deletions
+11
-0
coreapi/chat.c
coreapi/chat.c
+6
-0
coreapi/message_storage.c
coreapi/message_storage.c
+5
-0
No files found.
coreapi/chat.c
View file @
735268f8
...
...
@@ -750,6 +750,10 @@ LinphoneReason linphone_core_message_received(LinphoneCore *lc, SalOp *op, const
cr
->
unread_count
=
1
;
else
cr
->
unread_count
++
;
/* Mark the message as pending so that if linphone_core_chat_room_mark_as_read() is called
in the linphone_chat_room_message_received() callback, it will effectively be marked as
being read before being stored. */
cr
->
pending_message
=
msg
;
}
linphone_chat_room_message_received
(
cr
,
lc
,
msg
);
...
...
@@ -758,6 +762,8 @@ LinphoneReason linphone_core_message_received(LinphoneCore *lc, SalOp *op, const
msg
->
storage_id
=
linphone_chat_message_store
(
msg
);
}
cr
->
pending_message
=
NULL
;
end:
linphone_address_unref
(
addr
);
if
(
msg
!=
NULL
)
linphone_chat_message_unref
(
msg
);
...
...
coreapi/message_storage.c
View file @
735268f8
...
...
@@ -456,6 +456,11 @@ void linphone_chat_room_mark_as_read(LinphoneChatRoom *cr){
sqlite3_free
(
buf
);
ms_free
(
peer
);
if
(
cr
->
pending_message
)
{
linphone_chat_message_set_state
(
cr
->
pending_message
,
LinphoneChatMessageStateDisplayed
);
linphone_chat_message_send_display_notification
(
cr
->
pending_message
);
}
cr
->
unread_count
=
0
;
}
...
...
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