]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Prevent a crash when a buddy gets offline.
authorPhilippe Sultan <philippe.sultan@gmail.com>
Thu, 18 Mar 2010 15:59:19 +0000 (15:59 +0000)
committerPhilippe Sultan <philippe.sultan@gmail.com>
Thu, 18 Mar 2010 15:59:19 +0000 (15:59 +0000)
(closes issue #16760)
Reported by: fiddur
Patches:
      248394.diff uploaded by fiddur (license 678)i with modifications by me
Tested by: fiddur, phsultan

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@253261 65c4cc65-6c06-0410-ace0-fbb531ad65f3

res/res_jabber.c

index d71cf0fb0d73b66ab31ee968535f50263a498749..04038eabfb607fa2ffdb6b6ce218b9216a1e1ba4 100644 (file)
@@ -2395,11 +2395,17 @@ static void aji_handle_presence(struct aji_client *client, ikspak *pak)
                ast_debug(3, "JABBER: Kinky! how did that happen %i\n", pak->show);
        }
 
+    if (found) {
        manager_event(EVENT_FLAG_USER, "JabberStatus",
                        "Account: %s\r\nJID: %s\r\nResource: %s\r\nStatus: %d\r\nPriority: %d"
                        "\r\nDescription: %s\r\n",
                        client->name, pak->from->partial, found->resource, found->status,
                        found->priority, found->description);
+    } else {
+       manager_event(EVENT_FLAG_USER, "JabberStatus",
+                       "Account: %s\r\nJID: %s\r\nStatus: %d\r\n",
+                       client->name, pak->from->partial, pak->show ? pak->show:IKS_SHOW_UNAVAILABLE);
+    }
 }
 
 /*!