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

Merge branch 'master' into pgp

This commit is contained in:
James Booth 2015-05-04 00:57:17 +01:00
commit bb2b5d20d5
5 changed files with 13 additions and 15 deletions

View File

@ -70,7 +70,7 @@ cl_ev_send_msg(ProfChatWin *chatwin, const char * const msg)
#else #else
char *id = message_send_chat(chatwin->barejid, msg); char *id = message_send_chat(chatwin->barejid, msg);
chat_log_msg_out(chatwin->barejid, msg); chat_log_msg_out(chatwin->barejid, msg);
ui_outgoing_chat_msg(chatwin->barejid, msg, id); ui_outgoing_chat_msg(chatwin, msg, id);
free(id); free(id);
#endif #endif
} }

View File

@ -325,7 +325,7 @@ otr_on_message_send(ProfChatWin *chatwin, const char * const message)
if (encrypted) { if (encrypted) {
id = message_send_chat_encrypted(chatwin->barejid, encrypted); id = message_send_chat_encrypted(chatwin->barejid, encrypted);
chat_log_otr_msg_out(chatwin->barejid, message); chat_log_otr_msg_out(chatwin->barejid, message);
ui_outgoing_chat_msg(chatwin->barejid, message, id); ui_outgoing_chat_msg(chatwin, message, id);
otr_free_message(encrypted); otr_free_message(encrypted);
} else { } else {
ui_win_error_line((ProfWin*)chatwin, "Failed to encrypt and send message."); ui_win_error_line((ProfWin*)chatwin, "Failed to encrypt and send message.");
@ -339,13 +339,13 @@ otr_on_message_send(ProfChatWin *chatwin, const char * const message)
} else if (policy == PROF_OTRPOLICY_OPPORTUNISTIC) { } else if (policy == PROF_OTRPOLICY_OPPORTUNISTIC) {
char *otr_tagged_msg = otr_tag_message(message); char *otr_tagged_msg = otr_tag_message(message);
id = message_send_chat_encrypted(chatwin->barejid, otr_tagged_msg); id = message_send_chat_encrypted(chatwin->barejid, otr_tagged_msg);
ui_outgoing_chat_msg(chatwin->barejid, message, id); ui_outgoing_chat_msg(chatwin, message, id);
chat_log_msg_out(chatwin->barejid, message); chat_log_msg_out(chatwin->barejid, message);
free(otr_tagged_msg); free(otr_tagged_msg);
} else { } else {
id = message_send_chat(chatwin->barejid, message); id = message_send_chat(chatwin->barejid, message);
ui_outgoing_chat_msg(chatwin->barejid, message, id); ui_outgoing_chat_msg(chatwin, message, id);
chat_log_msg_out(chatwin->barejid, message); chat_log_msg_out(chatwin->barejid, message);
} }

View File

@ -433,15 +433,15 @@ ui_incoming_msg(const char * const barejid, const char * const resource, const c
win_print_incoming_message(window, tv_stamp, display_name, message); win_print_incoming_message(window, tv_stamp, display_name, message);
} }
if (prefs_get_boolean(PREF_BEEP)) {
beep();
}
int ui_index = num; int ui_index = num;
if (ui_index == 10) { if (ui_index == 10) {
ui_index = 0; ui_index = 0;
} }
if (prefs_get_boolean(PREF_BEEP)) {
beep();
}
if (prefs_get_boolean(PREF_NOTIFY_MESSAGE)) { if (prefs_get_boolean(PREF_NOTIFY_MESSAGE)) {
gboolean is_current = wins_is_current(window); gboolean is_current = wins_is_current(window);
if ( !is_current || (is_current && prefs_get_boolean(PREF_NOTIFY_MESSAGE_CURRENT)) ) { if ( !is_current || (is_current && prefs_get_boolean(PREF_NOTIFY_MESSAGE_CURRENT)) ) {
@ -1329,14 +1329,12 @@ ui_new_chat_win(const char * const barejid)
} }
void void
ui_outgoing_chat_msg(const char * const barejid, const char * const message, char *id) ui_outgoing_chat_msg(ProfChatWin *chatwin, const char * const message, char *id)
{ {
ProfWin *window = (ProfWin*)wins_get_chat(barejid);
if (prefs_get_boolean(PREF_RECEIPTS_REQUEST) && id) { if (prefs_get_boolean(PREF_RECEIPTS_REQUEST) && id) {
win_print_with_receipt(window, '-', NULL, 0, THEME_TEXT_ME, "me", message, id); win_print_with_receipt((ProfWin*)chatwin, '-', NULL, 0, THEME_TEXT_ME, "me", message, id);
} else { } else {
win_print(window, '-', NULL, 0, THEME_TEXT_ME, "me", message); win_print((ProfWin*)chatwin, '-', NULL, 0, THEME_TEXT_ME, "me", message);
} }
} }

View File

@ -120,7 +120,7 @@ void ui_message_receipt(const char * const barejid, const char * const id);
void ui_disconnected(void); void ui_disconnected(void);
void ui_recipient_gone(const char * const barejid, const char * const resource); void ui_recipient_gone(const char * const barejid, const char * const resource);
void ui_outgoing_chat_msg(const char * const barejid, const char * const message, char *id); void ui_outgoing_chat_msg(ProfChatWin *chatwin, const char * const message, char *id);
void ui_outgoing_chat_msg_carbon(const char * const barejid, const char * const message); void ui_outgoing_chat_msg_carbon(const char * const barejid, const char * const message);
void ui_outgoing_private_msg(const char * const fulljid, const char * const message); void ui_outgoing_private_msg(const char * const fulljid, const char * const message);

View File

@ -190,7 +190,7 @@ void ui_incoming_private_msg(const char * const fulljid, const char * const mess
void ui_disconnected(void) {} void ui_disconnected(void) {}
void ui_recipient_gone(const char * const barejid, const char * const resource) {} void ui_recipient_gone(const char * const barejid, const char * const resource) {}
void ui_outgoing_chat_msg(const char * const barejid, const char * const message, char *id) {} void ui_outgoing_chat_msg(ProfChatWin *chatwin, const char * const message, char *id) {}
void ui_outgoing_chat_msg_carbon(const char * const barejid, const char * const message) {} void ui_outgoing_chat_msg_carbon(const char * const barejid, const char * const message) {}
void ui_outgoing_private_msg(const char * const fulljid, const char * const message) {} void ui_outgoing_private_msg(const char * const fulljid, const char * const message) {}