1
1
mirror of https://github.com/profanity-im/profanity.git synced 2025-02-02 15:08:15 -05:00

Moved incoming message code to profanity module

This commit is contained in:
James Booth 2012-10-01 23:41:36 +01:00
parent 79796ca129
commit 9f00ef14d2
3 changed files with 18 additions and 4 deletions

View File

@ -311,8 +311,7 @@ _jabber_message_handler(xmpp_conn_t * const conn,
} else if (xmpp_stanza_get_child_by_name(stanza, "composing") != NULL) {
// composing
char *from = xmpp_stanza_get_attribute(stanza, "from");
win_show_typing(from);
win_page_off();
prof_handle_typing(from);
}
}
@ -326,8 +325,7 @@ _jabber_message_handler(xmpp_conn_t * const conn,
char *message = xmpp_stanza_get_text(body);
char *from = xmpp_stanza_get_attribute(stanza, "from");
win_show_incomming_msg(from, message);
win_page_off();
prof_handle_incoming_message(from, message);
if (prefs_get_chlog()) {
char from_cpy[strlen(from) + 1];

View File

@ -179,6 +179,20 @@ _process_input(char *inp)
return result;
}
void
prof_handle_typing(char *from)
{
win_show_typing(from);
win_page_off();
}
void
prof_handle_incoming_message(char *from, char *message)
{
win_show_incomming_msg(from, message);
win_page_off();
}
static void
_create_config_directory()
{

View File

@ -25,6 +25,8 @@
void profanity_init(const int disable_tls, char *log_level);
void profanity_run(void);
void prof_handle_typing(char *from);
void prof_handle_incoming_message(char *from, char *message);
void profanity_shutdown_init(void);
void profanity_shutdown(void);