Fix bug that caused dropping of group chat messages when leaving the chat window open during reconnect
This commit is contained in:
parent
e7554c739c
commit
8c859ad825
1 changed files with 8 additions and 7 deletions
15
tgp-chat.c
15
tgp-chat.c
|
@ -41,16 +41,17 @@ void chat_users_update (struct tgl_state *TLS, struct tgl_chat *chat) {
|
|||
PurpleConversation *chat_show (PurpleConnection *gc, int id) {
|
||||
connection_data *conn = purple_connection_get_protocol_data(gc);
|
||||
PurpleConversation *convo = purple_find_chat (gc, id);
|
||||
PurpleConvChat *chat = purple_conversation_get_chat_data (convo);
|
||||
tgl_peer_t *P = tgl_peer_get (conn->TLS, TGL_MK_CHAT(id));
|
||||
|
||||
if (! convo) {
|
||||
if (! P) {
|
||||
warning ("Chat %d not existing, not showing...", id);
|
||||
return NULL;
|
||||
}
|
||||
convo = p2tgl_got_joined_chat (conn->TLS, &P->chat);
|
||||
chat_users_update (conn->TLS, &P->chat);
|
||||
if (! P) {
|
||||
warning ("Chat %d not existing, not showing...", id);
|
||||
return NULL;
|
||||
}
|
||||
if (! convo || (chat && purple_conv_chat_has_left (chat))) {
|
||||
convo = p2tgl_got_joined_chat (conn->TLS, &P->chat);
|
||||
}
|
||||
chat_users_update (conn->TLS, &P->chat);
|
||||
|
||||
return convo;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue