Subscriptions don't work

Events happening in the community are now at Drupal community events on www.drupal.org.
aaron's picture

So I created a ticket in the DXMPP queue that I'm hoping to get some eyes on.

Basically, DXMPP registers users from the web server, and uses User Relationships to track a user's roster. Then on a user's page load, it sets a flag in Drupal.settings to add the users to their roster and subscribe via XMPP. After this is done, an AJAX call goes back to Drupal to keep things synchronized. Same on unsubscribe.

The roster stuff works fine. However, subscriptions don't seem to work. We're using the Strophe library to handle communication between the client and XMPP.

Here's the relevant (apparently) non-functional code:

var iq = $iq({jid: Drupal.settings.dxmpp.roster[user].jid}).c('set', {xmlns: 'jabber:iq:roster'});
        dxmppConnection.sendIQ(iq);

        dxmppConnection.send($pres({
          to: Drupal.settings.dxmpp.roster[user].jid,
          'type': 'subscribe'
        }));
        dxmppConnection.send($pres({
          to: Drupal.settings.dxmpp.roster[user].jid,
          'type': 'subscribed'
        }));

Any ideas?

Thanks,
Aaron

Comments

Oddly, it appears that

aaron's picture

Oddly, it appears that unsubscribing before subscribing fixes the issue. Perhaps the XMPP server gets stuck in a tizzy somewhere along the line...

Aaron Winborn
Drupal Multimedia (my book, available now!)
AaronWinborn.com
Advomatic

Chat

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: