mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-05-03 20:46:28 +00:00
Prevent message state from going to early states if it has reached the delivered to user or displayed state.
This commit is contained in:
parent
d5d0ed5056
commit
5d1a3ebfcd
1 changed files with 3 additions and 2 deletions
|
|
@ -144,8 +144,9 @@ static void _linphone_chat_room_destroy(LinphoneChatRoom *cr) {
|
|||
void linphone_chat_message_set_state(LinphoneChatMessage *msg, LinphoneChatMessageState state) {
|
||||
/* do not invoke callbacks on orphan messages */
|
||||
if (state != msg->state && msg->chat_room != NULL) {
|
||||
if ((msg->state == LinphoneChatMessageStateDisplayed) && (state == LinphoneChatMessageStateDeliveredToUser)) {
|
||||
/* If the message has been displayed we must not go back to the delivered to user state. */
|
||||
if (((msg->state == LinphoneChatMessageStateDisplayed) || (msg->state == LinphoneChatMessageStateDeliveredToUser))
|
||||
&& ((state == LinphoneChatMessageStateDeliveredToUser) || (state == LinphoneChatMessageStateDelivered) || (state == LinphoneChatMessageStateNotDelivered))) {
|
||||
/* If the message has been displayed or delivered to user we must not go back to the delivered or not delivered state. */
|
||||
return;
|
||||
}
|
||||
ms_message("Chat message %p: moving from state %s to %s", msg, linphone_chat_message_state_to_string(msg->state),
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue