1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-12-04 14:46:46 -05:00

Clean-up: defines cmd_funcs.c

This commit is contained in:
DebXWoody 2020-06-20 06:45:40 +02:00
parent c81931c35d
commit b7f959bab4
No known key found for this signature in database
GPG Key ID: C2DC916F35751C24

View File

@ -2187,24 +2187,13 @@ cmd_msg(ProfWin *window, const char *const command, gchar **args)
} }
ui_focus_win((ProfWin*)chatwin); ui_focus_win((ProfWin*)chatwin);
#ifdef HAVE_OMEMO gboolean is_otr_secure = FALSE;
#ifndef HAVE_LIBOTR
if (omemo_automatic_start(barejid)) {
omemo_start_session(barejid);
chatwin->is_omemo = TRUE;
}
if (msg) {
cl_ev_send_msg(chatwin, msg, NULL);
}
return TRUE;
#endif
#endif
#ifdef HAVE_OMEMO
#ifdef HAVE_LIBOTR #ifdef HAVE_LIBOTR
if (omemo_automatic_start(barejid) && otr_is_secure(barejid)) { is_otr_secure = otr_is_secure(barejid);
#endif // HAVE_LIBOTR
if (omemo_automatic_start(barejid) && is_otr_secure) {
win_println(window, THEME_DEFAULT, "!", "Chat could be either OMEMO or OTR encrypted. Use '/omemo start %s' or '/otr start %s' to start a session.", usr, usr); win_println(window, THEME_DEFAULT, "!", "Chat could be either OMEMO or OTR encrypted. Use '/omemo start %s' or '/otr start %s' to start a session.", usr, usr);
return TRUE; return TRUE;
} else if (omemo_automatic_start(barejid)) { } else if (omemo_automatic_start(barejid)) {
@ -2215,39 +2204,14 @@ cmd_msg(ProfWin *window, const char *const command, gchar **args)
if (msg) { if (msg) {
cl_ev_send_msg(chatwin, msg, NULL); cl_ev_send_msg(chatwin, msg, NULL);
} else { } else {
if (otr_is_secure(barejid)) {
chatwin_otr_secured(chatwin, otr_is_trusted(barejid));
}
}
return TRUE;
#endif
#endif
#ifndef HAVE_OMEMO
#ifdef HAVE_LIBOTR #ifdef HAVE_LIBOTR
if (msg) {
cl_ev_send_msg(chatwin, msg, NULL);
} else {
if (otr_is_secure(barejid)) { if (otr_is_secure(barejid)) {
chatwin_otr_secured(chatwin, otr_is_trusted(barejid)); chatwin_otr_secured(chatwin, otr_is_trusted(barejid));
} }
#endif // HAVE_LIBOTR
} }
return TRUE; return TRUE;
#endif
#endif
#ifndef HAVE_OMEMO
#ifndef HAVE_LIBOTR
if (msg) {
cl_ev_send_msg(chatwin, msg, NULL);
}
return TRUE;
#endif
#endif
} }
} }