about summary refs log tree commit diff stats
path: root/src/server_events.c
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2014-12-29 01:17:59 +0000
committerJames Booth <boothj5@gmail.com>2014-12-29 01:17:59 +0000
commit10a3a3a67504225ffaaee6aabb39831db36c8f31 (patch)
treea0fa083c4f888e2908c9a83203d2f25232a3c279 /src/server_events.c
parent4be06c0ae270ad8a04abba85ef3c608527a29d2c (diff)
downloadprofani-tty-10a3a3a67504225ffaaee6aabb39831db36c8f31.tar.gz
Use events for chat sessions
Diffstat (limited to 'src/server_events.c')
-rw-r--r--src/server_events.c12
1 files changed, 5 insertions, 7 deletions
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);
     }
 }