Fixed chat state for non OTR

This commit is contained in:
James Booth
2014-12-28 22:40:59 +00:00
parent 53ecd3b383
commit ac4b59eda0
8 changed files with 41 additions and 160 deletions

View File

@@ -320,16 +320,7 @@ handle_incoming_message(char *barejid, char *message)
memmove(whitespace_base, whitespace_base+tag_length, tag_length);
char *otr_query_message = otr_start_query();
cons_show("OTR Whitespace pattern detected. Attempting to start OTR session...");
gboolean send_state = FALSE;
if (prefs_get_boolean(PREF_STATES)) {
if (!chat_session_exists(barejid)) {
chat_session_start(barejid, TRUE);
}
if (chat_session_get_recipient_supports(barejid)) {
chat_session_set_active(barejid);
send_state = TRUE;
}
}
gboolean send_state = chat_session_on_message_send(barejid);
message_send_chat(barejid, NULL, otr_query_message, send_state);
}
}
@@ -344,16 +335,7 @@ handle_incoming_message(char *barejid, char *message)
if (policy == PROF_OTRPOLICY_ALWAYS && !was_decrypted && !whitespace_base) {
char *otr_query_message = otr_start_query();
cons_show("Attempting to start OTR session...");
gboolean send_state = FALSE;
if (prefs_get_boolean(PREF_STATES)) {
if (!chat_session_exists(barejid)) {
chat_session_start(barejid, TRUE);
}
if (chat_session_get_recipient_supports(barejid)) {
chat_session_set_active(barejid);
send_state = TRUE;
}
}
gboolean send_state = chat_session_on_message_send(barejid);
message_send_chat(barejid, NULL, otr_query_message, send_state);
}