mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-23 11:46:21 +00:00
Refactored chat session handling on sending message
This commit is contained in:
@@ -318,15 +318,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...");
|
||||
char *resource = NULL;
|
||||
gboolean send_state = FALSE;
|
||||
if (chat_session_exists(barejid)) {
|
||||
resource = chat_session_get_resource(barejid);
|
||||
send_state = chat_session_on_message_send(barejid);
|
||||
} else {
|
||||
send_state = TRUE;
|
||||
}
|
||||
message_send_chat(barejid, resource, otr_query_message, send_state);
|
||||
message_send_chat(barejid, otr_query_message);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -340,15 +332,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...");
|
||||
char *resource = NULL;
|
||||
gboolean send_state = FALSE;
|
||||
if (chat_session_exists(barejid)) {
|
||||
resource = chat_session_get_resource(barejid);
|
||||
send_state = chat_session_on_message_send(barejid);
|
||||
} else {
|
||||
send_state = TRUE;
|
||||
}
|
||||
message_send_chat(barejid, resource, otr_query_message, send_state);
|
||||
message_send_chat(barejid, otr_query_message);
|
||||
}
|
||||
|
||||
ui_incoming_msg(barejid, newmessage, NULL);
|
||||
|
||||
Reference in New Issue
Block a user