Add prof.encryption_reset to Plugins API

issue #885
This commit is contained in:
James Booth
2017-01-18 22:46:29 +00:00
parent 70e831e08b
commit fccf56be10
8 changed files with 88 additions and 0 deletions

View File

@@ -497,3 +497,25 @@ api_disco_add_feature(char *plugin_name, char *feature)
}
}
void
api_encryption_reset(const char *const barejid)
{
if (barejid == NULL) {
return;
}
ProfChatWin *chatwin = wins_get_chat(barejid);
if (chatwin == NULL) {
return;
}
if (chatwin->pgp_send) {
chatwin->pgp_send = FALSE;
win_println((ProfWin*)chatwin, THEME_DEFAULT, '!', "PGP encryption disabled.");
}
if (chatwin->is_otr) {
chatwin_otr_unsecured(chatwin);
otr_end_session(chatwin->barejid);
}
}