0

I'm learning xmpp with strophe.js , backbone.

I'm developing friend request sending functionality in my web site. For this i have written following code in backbone :

            var statusClass = constants.loggedInUserDetails.Status;
            var user1JIDXmpp = params.userID + 'xmppExtensionName: "@exterprise1.com/foobar"';
            connection.send($pres({ to: user1JIDXmpp, type: "subscribed" }));

            if (statusClass == 'busy') {
                connection.send($pres({ to: user1JIDXmpp, type: "dnd" }).c("show").t("dnd"));
            }
            else if (statusClass == 'available') {
                connection.send($pres({ to: user1JIDXmpp, type: "available" }).c("priority").t("1"));
            }
            else if (statusClass == 'offline') {
                connection.send($pres({ to: user1JIDXmpp, type: "offline" }).c("status").t("unavailable"));
            }

and in strophe.roster.js written code for added contact in roster when received presence.

Issue I'm facing is : after this process if any contact changes presence then it is not notifying to contact which is been subscribed in roster.

It is notifying contact presence only after subscribed contact login again.

How to solve this problem ? Am I missing anything ?

Priyanka
  • 2,802
  • 14
  • 55
  • 88

0 Answers0