mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-19 00:26:22 +00:00
Fixed chat state for non OTR
This commit is contained in:
@@ -1803,17 +1803,7 @@ cmd_execute_default(const char * inp)
|
||||
if (otr_is_secure(chatwin->barejid)) {
|
||||
char *encrypted = otr_encrypt_message(chatwin->barejid, inp);
|
||||
if (encrypted != NULL) {
|
||||
gboolean send_state = FALSE;
|
||||
if (prefs_get_boolean(PREF_STATES)) {
|
||||
if (!chat_session_exists(chatwin->barejid)) {
|
||||
chat_session_start(chatwin->barejid, TRUE);
|
||||
}
|
||||
if (chat_session_get_recipient_supports(chatwin->barejid)) {
|
||||
chat_session_set_active(chatwin->barejid);
|
||||
send_state = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
gboolean send_state = chat_session_on_message_send(chatwin->barejid);
|
||||
message_send_chat(chatwin->barejid, chatwin->barejid, encrypted, send_state);
|
||||
otr_free_message(encrypted);
|
||||
if (prefs_get_boolean(PREF_CHLOG)) {
|
||||
@@ -1834,16 +1824,7 @@ cmd_execute_default(const char * inp)
|
||||
cons_show_error("Failed to send message.");
|
||||
}
|
||||
} else {
|
||||
gboolean send_state = FALSE;
|
||||
if (prefs_get_boolean(PREF_STATES)) {
|
||||
if (!chat_session_exists(chatwin->barejid)) {
|
||||
chat_session_start(chatwin->barejid, TRUE);
|
||||
}
|
||||
if (chat_session_get_recipient_supports(chatwin->barejid)) {
|
||||
chat_session_set_active(chatwin->barejid);
|
||||
send_state = TRUE;
|
||||
}
|
||||
}
|
||||
gboolean send_state = chat_session_on_message_send(chatwin->barejid);
|
||||
message_send_chat(chatwin->barejid, chatwin->resource, inp, send_state);
|
||||
if (prefs_get_boolean(PREF_CHLOG)) {
|
||||
const char *jid = jabber_get_fulljid();
|
||||
@@ -1855,16 +1836,7 @@ cmd_execute_default(const char * inp)
|
||||
ui_outgoing_chat_msg("me", chatwin->barejid, inp);
|
||||
}
|
||||
#else
|
||||
gboolean send_state = FALSE;
|
||||
if (prefs_get_boolean(PREF_STATES)) {
|
||||
if (!chat_session_exists(chatwin->barejid)) {
|
||||
chat_session_start(chatwin->barejid, TRUE);
|
||||
}
|
||||
if (chat_session_get_recipient_supports(chatwin->barejid)) {
|
||||
chat_session_set_active(chatwin->barejid);
|
||||
send_state = TRUE;
|
||||
}
|
||||
}
|
||||
gboolean send_state = chat_session_on_message_send(chatwin->barejid);
|
||||
message_send_chat(chatwin->barejid, chatwin->resource, inp, send_state);
|
||||
if (prefs_get_boolean(PREF_CHLOG)) {
|
||||
const char *jid = jabber_get_fulljid();
|
||||
|
||||
Reference in New Issue
Block a user