diff options
-rw-r--r-- | src/jabber.c | 6 | ||||
-rw-r--r-- | src/profanity.c | 14 | ||||
-rw-r--r-- | src/profanity.h | 2 |
3 files changed, 18 insertions, 4 deletions
diff --git a/src/jabber.c b/src/jabber.c index 3cdad108..dc80f9ba 100644 --- a/src/jabber.c +++ b/src/jabber.c @@ -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]; diff --git a/src/profanity.c b/src/profanity.c index 0a76dbff..94de6920 100644 --- a/src/profanity.c +++ b/src/profanity.c @@ -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() { diff --git a/src/profanity.h b/src/profanity.h index b04c3a52..8d2ae4fd 100644 --- a/src/profanity.h +++ b/src/profanity.h @@ -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); |