Skip to content

Commit

Permalink
Fixes the session close when connection ends
Browse files Browse the repository at this point in the history
This code is WIP and need revision
- Checks if the client conversation is encrypted
- Converts client conversation to plugin conversation in a better way
- Related to #65 and #69
  • Loading branch information
pedropalau committed Aug 14, 2019
1 parent e2c5c4f commit d3bcc49
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions gtk-dialog.c
Original file line number Diff line number Diff line change
Expand Up @@ -3097,13 +3097,21 @@ static void connection_signing_off_cb(PurpleConnection *conn) {
for (el = client->conversations; el; el = el->next) {
otr_conv = el->data;

otr_plugin_conv = otrng_plugin_conversation_new(otr_conv->conn);
if (!otr_conv) {
continue;
}

otrng_ui_disconnect_connection(otr_plugin_conv);
otrng_plugin_conversation_free(otr_plugin_conv);
if (!otrng_conversation_is_encrypted(otr_conv)) {
continue;
}

otr_plugin_conv =
client_conversation_to_plugin_conversation(otr_conv->conn);

if (otr_plugin_conv) {
otrng_ui_disconnect_connection(otr_plugin_conv);
otrng_plugin_conversation_free(otr_plugin_conv);
}
}
}

Expand Down

0 comments on commit d3bcc49

Please sign in to comment.