Multiple revisions 398558,398577

........
  r398558 | kmoore | 2013-09-06 14:28:16 -0500 (Fri, 06 Sep 2013) | 17 lines
  
  Fix Jabber/XMPP distributed MWI
  
  The mailbox and context are swapped on the receiving end for all users
  of Jabber and XMPP distributed MWI in Asterisk 1.8 and all more recent
  versions. This swaps those values to be correct when publishing to the
  internal event system from Jabber/XMPP distributed MWI state.
  
  (closes issue ASTERISK-22435)
  Reported by: abelbeck
  Tested by: Michael Keuter
  Patches:
      asterisk-1.8-res_jabber-aji_handle_pubsub_event.patch uploaded by abelbeck
      asterisk-11-res_xmpp-xmpp_pubsub_handle_event.patch uploaded by abelbeck
  ........
  
  Merged revisions 398523 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
  r398577 | kmoore | 2013-09-06 16:00:56 -0500 (Fri, 06 Sep 2013) | 10 lines
  
  Commit the remainder of r398523
  
  This is a missing part of the commit in revision 398523 that corrects
  the name of a variable.
  
  (issue ASTERISK-22435)
  ........
  
  Merged revisions 398576 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 398558,398577 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 398580 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@398603 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Kinsey Moore
2013-09-06 21:23:02 +00:00
parent 5396198f16
commit 0bed76989a
2 changed files with 6 additions and 6 deletions

View File

@@ -3330,7 +3330,7 @@ static void aji_init_event_distribution(struct aji_client *client)
*/
static int aji_handle_pubsub_event(void *data, ikspak *pak)
{
char *item_id, *device_state, *context, *cachable_str;
char *item_id, *device_state, *mailbox, *cachable_str;
int oldmsgs, newmsgs;
iks *item, *item_content;
struct ast_eid pubsub_eid;
@@ -3359,11 +3359,11 @@ static int aji_handle_pubsub_event(void *data, ikspak *pak)
&pubsub_eid);
return IKS_FILTER_EAT;
} else if (!strcasecmp(iks_name(item_content), "mailbox")) {
context = strsep(&item_id, "@");
mailbox = strsep(&item_id, "@");
sscanf(iks_find_cdata(item_content, "OLDMSGS"), "%10d", &oldmsgs);
sscanf(iks_find_cdata(item_content, "NEWMSGS"), "%10d", &newmsgs);
ast_publish_mwi_state_full(item_id, context, newmsgs, oldmsgs, NULL, &pubsub_eid);
ast_publish_mwi_state_full(mailbox, item_id, newmsgs, oldmsgs, NULL, &pubsub_eid);
return IKS_FILTER_EAT;
} else {

View File

@@ -1450,7 +1450,7 @@ static void xmpp_pubsub_subscribe(struct ast_xmpp_client *client, const char *no
*/
static int xmpp_pubsub_handle_event(void *data, ikspak *pak)
{
char *item_id, *device_state, *context, *cachable_str;
char *item_id, *device_state, *mailbox, *cachable_str;
int oldmsgs, newmsgs;
iks *item, *item_content;
struct ast_eid pubsub_eid;
@@ -1478,11 +1478,11 @@ static int xmpp_pubsub_handle_event(void *data, ikspak *pak)
&pubsub_eid);
return IKS_FILTER_EAT;
} else if (!strcasecmp(iks_name(item_content), "mailbox")) {
context = strsep(&item_id, "@");
mailbox = strsep(&item_id, "@");
sscanf(iks_find_cdata(item_content, "OLDMSGS"), "%10d", &oldmsgs);
sscanf(iks_find_cdata(item_content, "NEWMSGS"), "%10d", &newmsgs);
ast_publish_mwi_state_full(item_id, context, newmsgs, oldmsgs, NULL, &pubsub_eid);
ast_publish_mwi_state_full(mailbox, item_id, newmsgs, oldmsgs, NULL, &pubsub_eid);
return IKS_FILTER_EAT;
} else {