From 10a3a3a67504225ffaaee6aabb39831db36c8f31 Mon Sep 17 00:00:00 2001 From: James Booth Date: Mon, 29 Dec 2014 01:17:59 +0000 Subject: Use events for chat sessions --- src/server_events.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'src/server_events.c') diff --git a/src/server_events.c b/src/server_events.c index 96014bf4..9d7883d6 100644 --- a/src/server_events.c +++ b/src/server_events.c @@ -77,23 +77,21 @@ handle_presence_error(const char *from, const char * const type, // handle message stanza errors void -handle_message_error(const char * const from, const char * const type, +handle_message_error(const char * const jid, const char * const type, const char * const err_msg) { // handle errors from no recipient - if (from == NULL) { + if (jid == NULL) { ui_handle_error(err_msg); // handle recipient not found ('from' contains a value and type is 'cancel') } else if (type != NULL && (strcmp(type, "cancel") == 0)) { - ui_handle_recipient_not_found(from, err_msg); - if (prefs_get_boolean(PREF_STATES) && chat_session_exists(from)) { - chat_session_set_recipient_supports(from, FALSE); - } + ui_handle_recipient_not_found(jid, err_msg); + chat_session_on_cancel(jid); // handle any other error from recipient } else { - ui_handle_recipient_error(from, err_msg); + ui_handle_recipient_error(jid, err_msg); } } -- cgit 1.4.1-2-gfad0