]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Merged revisions 198371 via svnmerge from
authorSean Bright <sean@malleable.com>
Sat, 30 May 2009 19:40:59 +0000 (19:40 +0000)
committerSean Bright <sean@malleable.com>
Sat, 30 May 2009 19:40:59 +0000 (19:40 +0000)
https://origsvn.digium.com/svn/asterisk/trunk

................
  r198371 | seanbright | 2009-05-30 15:38:58 -0400 (Sat, 30 May 2009) | 19 lines

  Merged revisions 198370 via svnmerge from
  https://origsvn.digium.com/svn/asterisk/branches/1.4

  ........
    r198370 | seanbright | 2009-05-30 15:36:20 -0400 (Sat, 30 May 2009) | 12 lines

    Properly terminate AMI JabberSend response messages.

    The response message (either Error or Success) needs an extra trailing \r\n
    after the fields to inform the client that the message is complete.

    (closes issue #14876)
    Reported by: srt
    Patches:
          05302009_1.4_res_jabber.c.diff uploaded by seanbright (license 71)
          asterisk_14876.patch uploaded by srt (license 378)
          trunk-14876-2.diff uploaded by phsultan (license 73)
  ........
................

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

res/res_jabber.c

index d2ce3b156c8914cfa927137ebec9794b735a53b2..053056ce94fdde51f29d0c21e2424a77e7ba4326 100644 (file)
@@ -2978,17 +2978,17 @@ static int manager_jabber_send(struct mansession *s, const struct message *m)
        if (!client) {
                astman_send_error(s, m, "Could not find Sender");
                return 0;
-       }       
-       if (strchr(screenname, '@') && message){
-               ast_aji_send_chat(client, screenname, message); 
+       }
+       if (strchr(screenname, '@') && message) {
+               ast_aji_send_chat(client, screenname, message);
                astman_append(s, "Response: Success\r\n");
-               if (!ast_strlen_zero(id))
-                       astman_append(s, "ActionID: %s\r\n",id);
-               return 0;
+       } else {
+               astman_append(s, "Response: Error\r\n");
        }
-       astman_append(s, "Response: Error\r\n");
-       if (!ast_strlen_zero(id))
+       if (!ast_strlen_zero(id)) {
                astman_append(s, "ActionID: %s\r\n",id);
+       }
+       astman_append(s, "\r\n");
        return 0;
 }