librelist archives

« back to archive

Reg : How to get buddy list

Reg : How to get buddy list

From:
Gowthaman m
Date:
2015-02-19 @ 05:56
Hi

  I have tried to the getting buddies list by JID. But when i am passing
the "jid@mydomain.com" i am getting null value because of always "contact"
return null


var _transform = function (jid) {
     var contact = converse.roster.get(Strophe.getBareJidFromJid(jid));
    console.log("....contacts.....",contact)  =>undefined
     if (contact) {
         return contact.attributes;
     }
     return null;
 };
 if (typeof jids === "string") {
     return _transform(jids);
 }
 return _.map(jids, _transform);
 };



Thanks

Gowthaman M <http://erated.me/p/gowthaman-murugan/>