StropheCappuccino API 1.0.0
/tmp/tempDoc.doc/Build/StropheCappuccino.build/Debug/Browser.environment/Sources/TNStropheRoster.j
Go to the documentation of this file.
00001 @STATIC;1.0;I;23;Foundation/Foundation.ji;28;Resources/Strophe/strophe.jsi;14;TNStropheJID.ji;21;TNStropheRosterBase.jt;43239;objj_executeFile("Foundation/Foundation.j", NO);objj_executeFile("Resources/Strophe/strophe.js", YES);objj_executeFile("TNStropheJID.j", YES);objj_executeFile("TNStropheRosterBase.j", YES);TNStropheRosterRosterDelimiter = "::";
00002 TNStropheRosterContactAddedNotification = "TNStropheRosterContactAddedNotification";
00003 TNStropheRosterContactRemovedNotification = "TNStropheRosterContactRemovedNotification";
00004 TNStropheRosterGroupAddedNotification = "TNStropheRosterGroupAddedNotification";
00005 TNStropheRosterGroupRemovedNotification = "TNStropheRosterGroupRemovedNotification";
00006 TNStropheRosterGroupRenamedNotification = "TNStropheRosterGroupRenamedNotification";
00007 TNStropheRosterPushAddedContactNotification = "TNStropheRosterPushAddedContactNotification";
00008 TNStropheRosterPushNotification = "TNStropheRosterPushNotification";
00009 TNStropheRosterPushRemovedContactNotification = "TNStropheRosterPushRemovedContactNotification";
00010 TNStropheRosterPushUpdatedContactNotification = "TNStropheRosterPushUpdatedContactNotification";
00011 TNStropheRosterRetrievedNotification = "TNStropheRosterRetrievedNotification";
00012 TNStropheRosterSubGroupDelimiterReceivedNotification = "TNStropheRosterSubGroupDelimiterReceivedNotification";
00013 {var the_class = objj_allocateClassPair(TNStropheRosterBase, "TNStropheRoster"),
00014 meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_pendingPresence"), new objj_ivar("_rosterRetrieved")]);objj_registerClassPair(the_class);
00015 class_addMethods(the_class, [new objj_method(sel_getUid("pendingPresence"), function $TNStropheRoster__pendingPresence(self, _cmd)
00016 {
00017     return self._pendingPresence;
00018 }
00019 ,["CPDictionary"]), new objj_method(sel_getUid("_setPendingPresence:"), function $TNStropheRoster___setPendingPresence_(self, _cmd, newValue)
00020 {
00021     self._pendingPresence = newValue;
00022 }
00023 ,["void","CPDictionary"]), new objj_method(sel_getUid("initWithConnection:"), function $TNStropheRoster__initWithConnection_(self, _cmd, aConnection)
00024 {
00025     if (self = objj_msgSendSuper({ receiver:self, super_class:objj_getClass("TNStropheRoster").super_class }, "initWithConnection:", aConnection))
00026     {
00027         self._pendingPresence = CPDictionary.isa.objj_msgSend0(CPDictionary, "dictionary");
00028         var rosterPushParams = CPDictionary.isa.objj_msgSend(CPDictionary, "dictionaryWithObjectsAndKeys:", "iq", "name", Strophe.NS.ROSTER, "namespace", "set", "type"),
00029             presenceParams = CPDictionary.isa.objj_msgSend(CPDictionary, "dictionaryWithObjectsAndKeys:", "presence", "name", ((___r1 = ((___r2 = self._connection), ___r2 == null ? null : ___r2.isa.objj_msgSend0(___r2, "JID"))), ___r1 == null ? null : ___r1.isa.objj_msgSend0(___r1, "bare")) || CPNull.isa.objj_msgSend0(CPNull, "null"), "to");
00030         ((___r1 = self._connection), ___r1 == null ? null : ___r1.isa.objj_msgSend3(___r1, "registerSelector:ofObject:withDict:", sel_getUid("_didReceiveRosterPush:"), self, rosterPushParams));
00031         ((___r1 = self._connection), ___r1 == null ? null : ___r1.isa.objj_msgSend3(___r1, "registerSelector:ofObject:withDict:", sel_getUid("_didReceivePresence:"), self, presenceParams));
00032     }
00033     return self;
00034     var ___r1, ___r2;
00035 }
00036 ,["id","TNStropheConnection"]), new objj_method(sel_getUid("clear"), function $TNStropheRoster__clear(self, _cmd)
00037 {
00038     for (var i = 0; i < ((___r1 = self._groupCache), ___r1 == null ? null : ___r1.isa.objj_msgSend0(___r1, "count")); i++)
00039         ((___r1 = ((___r2 = self._groupCache), ___r2 == null ? null : ___r2.isa.objj_msgSend1(___r2, "objectAtIndex:", i))), ___r1 == null ? null : ___r1.isa.objj_msgSend0(___r1, "removeSubGroups"));
00040     ((___r1 = self._groupCache), ___r1 == null ? null : ___r1.isa.objj_msgSend0(___r1, "removeAllObjects"));
00041     ((___r1 = self._pendingPresence), ___r1 == null ? null : ___r1.isa.objj_msgSend0(___r1, "removeAllObjects"));
00042     self._rosterRetrieved = NO;
00043     objj_msgSendSuper({ receiver:self, super_class:objj_getClass("TNStropheRoster").super_class }, "clear");
00044     var ___r1, ___r2;
00045 }
00046 ,["void"]), new objj_method(sel_getUid("getSubGroupDelimiter"), function $TNStropheRoster__getSubGroupDelimiter(self, _cmd)
00047 {
00048     var uid = ((___r1 = self._connection), ___r1 == null ? null : ___r1.isa.objj_msgSend0(___r1, "getUniqueId")),
00049         stanza = TNStropheStanza.isa.objj_msgSend1(TNStropheStanza, "iqWithAttributes:", {"id": uid, "type": "get"}),
00050         params = CPDictionary.isa.objj_msgSend2(CPDictionary, "dictionaryWithObjectsAndKeys:", uid, "id");
00051     (stanza == null ? null : stanza.isa.objj_msgSend2(stanza, "addChildWithName:andAttributes:", "query", {"xmlns": "jabber:iq:private"}));
00052     (stanza == null ? null : stanza.isa.objj_msgSend2(stanza, "addChildWithName:andAttributes:", "roster", {"xmlns": "roster:delimiter"}));
00053     ((___r1 = self._connection), ___r1 == null ? null : ___r1.isa.objj_msgSend3(___r1, "registerSelector:ofObject:withDict:", sel_getUid("_didReceiveSubGroupDelimiter:"), self, params));
00054     ((___r1 = self._connection), ___r1 == null ? null : ___r1.isa.objj_msgSend1(___r1, "send:", stanza));
00055     var ___r1;
00056 }
00057 ,["void"]), new objj_method(sel_getUid("_didReceiveSubGroupDelimiter:"), function $TNStropheRoster___didReceiveSubGroupDelimiter_(self, _cmd, aStanza)
00058 {
00059     if ((aStanza == null ? null : aStanza.isa.objj_msgSend0(aStanza, "type")) == "result")
00060     {
00061         var delimiter = ((___r1 = (aStanza == null ? null : aStanza.isa.objj_msgSend1(aStanza, "firstChildWithName:", "roster"))), ___r1 == null ? null : ___r1.isa.objj_msgSend0(___r1, "text"));
00062         if (!delimiter == "" && !delimiter == " ")
00063             TNStropheRosterRosterDelimiter = delimiter;
00064         else
00065             self.isa.objj_msgSend1(self, "setSubGroupDelimiter:", TNStropheRosterRosterDelimiter);
00066     }
00067     else
00068     {
00069         CPLog.error("Cannot get the roster delimiter");
00070     }
00071     ((___r1 = CPNotificationCenter.isa.objj_msgSend0(CPNotificationCenter, "defaultCenter")), ___r1 == null ? null : ___r1.isa.objj_msgSend2(___r1, "postNotificationName:object:", TNStropheRosterSubGroupDelimiterReceivedNotification, self));
00072     return NO;
00073     var ___r1;
00074 }
00075 ,["BOOL","TNStropheStanza"]), new objj_method(sel_getUid("setSubGroupDelimiter:"), function $TNStropheRoster__setSubGroupDelimiter_(self, _cmd, aDelimiter)
00076 {
00077     var uid = ((___r1 = self._connection), ___r1 == null ? null : ___r1.isa.objj_msgSend0(___r1, "getUniqueId")),
00078         stanza = TNStropheStanza.isa.objj_msgSend1(TNStropheStanza, "iqWithAttributes:", {"id": uid, "type": "set"}),
00079         params = CPDictionary.isa.objj_msgSend2(CPDictionary, "dictionaryWithObjectsAndKeys:", uid, "id");
00080     (stanza == null ? null : stanza.isa.objj_msgSend2(stanza, "addChildWithName:andAttributes:", "query", {"xmlns": "jabber:iq:private"}));
00081     (stanza == null ? null : stanza.isa.objj_msgSend2(stanza, "addChildWithName:andAttributes:", "roster", {"xmlns": "roster:delimiter"}));
00082     (stanza == null ? null : stanza.isa.objj_msgSend1(stanza, "addTextNode:", aDelimiter));
00083     ((___r1 = self._connection), ___r1 == null ? null : ___r1.isa.objj_msgSend3(___r1, "registerSelector:ofObject:withDict:", sel_getUid("_didsetSubGroupDelimiter:"), self, params));
00084     ((___r1 = self._connection), ___r1 == null ? null : ___r1.isa.objj_msgSend1(___r1, "send:", stanza));
00085     var ___r1;
00086 }
00087 ,["void","CPString"]), new objj_method(sel_getUid("_didsetSubGroupDelimiter:"), function $TNStropheRoster___didsetSubGroupDelimiter_(self, _cmd, aStanza)
00088 {
00089     if ((aStanza == null ? null : aStanza.isa.objj_msgSend0(aStanza, "type")) == "result")
00090         CPLog.info("roster's subgroup delimiter has been set");
00091     else
00092         CPLog.error("Cannot get the roster delimiter");
00093     return NO;
00094 }
00095 ,["BOOL","TNStropheStanza"]), new objj_method(sel_getUid("getRoster"), function $TNStropheRoster__getRoster(self, _cmd)
00096 {
00097     var uid = ((___r1 = self._connection), ___r1 == null ? null : ___r1.isa.objj_msgSend1(___r1, "getUniqueIdWithSuffix:", "roster")),
00098         rosteriq = TNStropheStanza.isa.objj_msgSend1(TNStropheStanza, "iqWithAttributes:", {"id": uid, "type": "get"}),
00099         rosterResultParams = CPDictionary.isa.objj_msgSend2(CPDictionary, "dictionaryWithObjectsAndKeys:", uid, "id");
00100     (rosteriq == null ? null : rosteriq.isa.objj_msgSend2(rosteriq, "addChildWithName:andAttributes:", "query", {'xmlns': Strophe.NS.ROSTER}));
00101     ((___r1 = self._connection), ___r1 == null ? null : ___r1.isa.objj_msgSend3(___r1, "registerSelector:ofObject:withDict:", sel_getUid("_didReceiveRosterResult:"), self, rosterResultParams));
00102     ((___r1 = self._connection), ___r1 == null ? null : ___r1.isa.objj_msgSend1(___r1, "send:", rosteriq));
00103     var ___r1;
00104 }
00105 ,["void"]), new objj_method(sel_getUid("_didReceiveRosterResult:"), function $TNStropheRoster___didReceiveRosterResult_(self, _cmd, aStanza)
00106 {
00107     var items = (aStanza == null ? null : aStanza.isa.objj_msgSend1(aStanza, "childrenWithName:", "item"));
00108     for (var i = 0; i < (items == null ? null : items.isa.objj_msgSend0(items, "count")); i++)
00109     {
00110         var item = (items == null ? null : items.isa.objj_msgSend1(items, "objectAtIndex:", i)),
00111             subscription = (item == null ? null : item.isa.objj_msgSend1(item, "valueForAttribute:", "subscription")),
00112             allowedSubs = CPArray.isa.objj_msgSend(CPArray, "arrayWithObjects:", "none", "to", "from", "both");
00113         if (!subscription || !(allowedSubs == null ? null : allowedSubs.isa.objj_msgSend1(allowedSubs, "containsObject:", subscription)))
00114             (item == null ? null : item.isa.objj_msgSend2(item, "setValue:forAttribute:", "none", "subscription"));
00115         if (!self.isa.objj_msgSend1(self, "containsJID:", TNStropheJID.isa.objj_msgSend1(TNStropheJID, "stropheJIDWithString:", (item == null ? null : item.isa.objj_msgSend1(item, "valueForAttribute:", "jid")))))
00116             self.isa.objj_msgSend1(self, "_addContactFromRosterItem:", item);
00117     }
00118     self._rosterRetrieved = YES;
00119     ((___r1 = CPNotificationCenter.isa.objj_msgSend0(CPNotificationCenter, "defaultCenter")), ___r1 == null ? null : ___r1.isa.objj_msgSend2(___r1, "postNotificationName:object:", TNStropheRosterRetrievedNotification, self));
00120     return NO;
00121     var ___r1;
00122 }
00123 ,["BOOL","id"]), new objj_method(sel_getUid("_sendRosterSet:"), function $TNStropheRoster___sendRosterSet_(self, _cmd, anObject)
00124 {
00125     var contents;
00126     switch((anObject == null ? null : anObject.isa.objj_msgSend0(anObject, "class"))) {
00127     case TNStropheContact:
00128         contents = CPArray.isa.objj_msgSend1(CPArray, "arrayWithObject:", anObject);
00129         break;
00130     case _CPJavaScriptArray:
00131     case CPArray:
00132         contents = anObject;
00133         break;
00134 default:
00135         CPLog.error("_sendRosterSet: only accepts TNStropheContact or CPArray. given " + (anObject == null ? null : anObject.isa.objj_msgSend0(anObject, "class")));
00136         return;
00137     }
00138     var stanza = TNStropheStanza.isa.objj_msgSend1(TNStropheStanza, "iqWithAttributes:", {"type": "set"});
00139     (stanza == null ? null : stanza.isa.objj_msgSend2(stanza, "addChildWithName:andAttributes:", "query", {'xmlns': Strophe.NS.ROSTER}));
00140     for (var i = 0; i < (contents == null ? null : contents.isa.objj_msgSend0(contents, "count")); i++)
00141     {
00142         var contact = (contents == null ? null : contents.isa.objj_msgSend1(contents, "objectAtIndex:", i));
00143         (stanza == null ? null : stanza.isa.objj_msgSend2(stanza, "addChildWithName:andAttributes:", "item", {"jid": ((___r1 = (contact == null ? null : contact.isa.objj_msgSend0(contact, "JID"))), ___r1 == null ? null : ___r1.isa.objj_msgSend0(___r1, "bare")), "name": (contact == null ? null : contact.isa.objj_msgSend0(contact, "nickname"))}));
00144         for (var j = 0; j < ((___r1 = (contact == null ? null : contact.isa.objj_msgSend0(contact, "groups"))), ___r1 == null ? null : ___r1.isa.objj_msgSend0(___r1, "count")); j++)
00145         {
00146             (stanza == null ? null : stanza.isa.objj_msgSend1(stanza, "addChildWithName:", "group"));
00147             (stanza == null ? null : stanza.isa.objj_msgSend1(stanza, "addTextNode:", ((___r1 = ((___r2 = (contact == null ? null : contact.isa.objj_msgSend0(contact, "groups"))), ___r2 == null ? null : ___r2.isa.objj_msgSend1(___r2, "objectAtIndex:", j))), ___r1 == null ? null : ___r1.isa.objj_msgSend0(___r1, "path"))));
00148             (stanza == null ? null : stanza.isa.objj_msgSend0(stanza, "up"));
00149         }
00150         (stanza == null ? null : stanza.isa.objj_msgSend0(stanza, "up"));
00151     }
00152     ((___r1 = self._connection), ___r1 == null ? null : ___r1.isa.objj_msgSend1(___r1, "send:", stanza));
00153     var ___r1, ___r2;
00154 }
00155 ,["void","id"]), new objj_method(sel_getUid("_sendRosterUnset:"), function $TNStropheRoster___sendRosterUnset_(self, _cmd, anObject)
00156 {
00157     var contents;
00158     switch((anObject == null ? null : anObject.isa.objj_msgSend0(anObject, "class"))) {
00159     case TNStropheContact:
00160         contents = CPArray.isa.objj_msgSend1(CPArray, "arrayWithObject:", anObject);
00161         break;
00162     case _CPJavaScriptArray:
00163     case CPArray:
00164         contents = anObject;
00165         break;
00166 default:
00167         CPLog.error("_sendRosterUnset: only accepts TNStropheContact or CPArray. given " + (anObject == null ? null : anObject.isa.objj_msgSend0(anObject, "class")));
00168         return;
00169     }
00170     var stanza = TNStropheStanza.isa.objj_msgSend1(TNStropheStanza, "iqWithAttributes:", {"type": "set"});
00171     (stanza == null ? null : stanza.isa.objj_msgSend2(stanza, "addChildWithName:andAttributes:", "query", {'xmlns': Strophe.NS.ROSTER}));
00172     for (var j = 0; j < (contents == null ? null : contents.isa.objj_msgSend0(contents, "count")); j++)
00173     {
00174         var contact = (contents == null ? null : contents.isa.objj_msgSend1(contents, "objectAtIndex:", j));
00175         (stanza == null ? null : stanza.isa.objj_msgSend2(stanza, "addChildWithName:andAttributes:", "item", {'jid': ((___r1 = (contact == null ? null : contact.isa.objj_msgSend0(contact, "JID"))), ___r1 == null ? null : ___r1.isa.objj_msgSend0(___r1, "bare")), 'subscription': 'remove'}));
00176         (stanza == null ? null : stanza.isa.objj_msgSend0(stanza, "up"));
00177     }
00178     ((___r1 = self._connection), ___r1 == null ? null : ___r1.isa.objj_msgSend1(___r1, "send:", stanza));
00179     var ___r1;
00180 }
00181 ,["void","id"]), new objj_method(sel_getUid("_didReceiveRosterPush:"), function $TNStropheRoster___didReceiveRosterPush_(self, _cmd, aStanza)
00182 {
00183     if (!self._rosterRetrieved)
00184         return;
00185     var item = (aStanza == null ? null : aStanza.isa.objj_msgSend1(aStanza, "firstChildWithName:", "item")),
00186         theJID = TNStropheJID.isa.objj_msgSend1(TNStropheJID, "stropheJIDWithString:", (item == null ? null : item.isa.objj_msgSend1(item, "valueForAttribute:", "jid"))),
00187         subscription = (item == null ? null : item.isa.objj_msgSend1(item, "valueForAttribute:", "subscription")),
00188         allowedSubs = CPArray.isa.objj_msgSend(CPArray, "arrayWithObjects:", "none", "to", "from", "both", "remove"),
00189         response = TNStropheStanza.isa.objj_msgSend2(TNStropheStanza, "iqTo:withAttributes:", (aStanza == null ? null : aStanza.isa.objj_msgSend0(aStanza, "from")), {"id": (aStanza == null ? null : aStanza.isa.objj_msgSend0(aStanza, "ID")), "type": "result"});
00190     if ((aStanza == null ? null : aStanza.isa.objj_msgSend0(aStanza, "from")) && !((___r1 = (aStanza == null ? null : aStanza.isa.objj_msgSend0(aStanza, "from"))), ___r1 == null ? null : ___r1.isa.objj_msgSend1(___r1, "bareEquals:", ((___r2 = self._connection), ___r2 == null ? null : ___r2.isa.objj_msgSend0(___r2, "JID")))))
00191         return YES;
00192     ((___r1 = self._connection), ___r1 == null ? null : ___r1.isa.objj_msgSend1(___r1, "send:", response));
00193     if (!subscription || !(allowedSubs == null ? null : allowedSubs.isa.objj_msgSend1(allowedSubs, "containsObject:", subscription)))
00194         (item == null ? null : item.isa.objj_msgSend2(item, "setValue:forAttribute:", "none", "subscription"));
00195     switch(subscription) {
00196     case "remove":
00197         self.isa.objj_msgSend1(self, "_deleteContactFromRosterItem:", item);
00198         ((___r1 = CPNotificationCenter.isa.objj_msgSend0(CPNotificationCenter, "defaultCenter")), ___r1 == null ? null : ___r1.isa.objj_msgSend3(___r1, "postNotificationName:object:userInfo:", TNStropheRosterPushRemovedContactNotification, self, theJID));
00199         break;
00200 default:
00201         if (self.isa.objj_msgSend1(self, "containsJID:", theJID))
00202         {
00203             self.isa.objj_msgSend1(self, "_updateContactFromRosterItem:", item);
00204             ((___r1 = CPNotificationCenter.isa.objj_msgSend0(CPNotificationCenter, "defaultCenter")), ___r1 == null ? null : ___r1.isa.objj_msgSend3(___r1, "postNotificationName:object:userInfo:", TNStropheRosterPushUpdatedContactNotification, self, theJID));
00205         }
00206         else
00207         {
00208             self.isa.objj_msgSend1(self, "_addContactFromRosterItem:", item);
00209             ((___r1 = CPNotificationCenter.isa.objj_msgSend0(CPNotificationCenter, "defaultCenter")), ___r1 == null ? null : ___r1.isa.objj_msgSend3(___r1, "postNotificationName:object:userInfo:", TNStropheRosterPushAddedContactNotification, self, theJID));
00210         }
00211         break;
00212     }
00213     ((___r1 = CPNotificationCenter.isa.objj_msgSend0(CPNotificationCenter, "defaultCenter")), ___r1 == null ? null : ___r1.isa.objj_msgSend2(___r1, "postNotificationName:object:", TNStropheRosterPushNotification, self));
00214     return YES;
00215     var ___r1, ___r2;
00216 }
00217 ,["BOOL","TNStropheStanzas"]), new objj_method(sel_getUid("_addContactFromRosterItem:"), function $TNStropheRoster___addContactFromRosterItem_(self, _cmd, aRosterItem)
00218 {
00219     var theJID = TNStropheJID.isa.objj_msgSend1(TNStropheJID, "stropheJIDWithString:", (aRosterItem == null ? null : aRosterItem.isa.objj_msgSend1(aRosterItem, "valueForAttribute:", "jid")));
00220     if ((theJID == null ? null : theJID.isa.objj_msgSend1(theJID, "bareEquals:", ((___r1 = self._connection), ___r1 == null ? null : ___r1.isa.objj_msgSend0(___r1, "JID")))))
00221         return;
00222     var contact = TNStropheContact.isa.objj_msgSend3(TNStropheContact, "contactWithConnection:JID:group:", self._connection, theJID, nil),
00223         nickname = (aRosterItem == null ? null : aRosterItem.isa.objj_msgSend1(aRosterItem, "valueForAttribute:", "name")) || (theJID == null ? null : theJID.isa.objj_msgSend0(theJID, "node")),
00224         groupNodes = (aRosterItem == null ? null : aRosterItem.isa.objj_msgSend1(aRosterItem, "childrenWithName:", "group")),
00225         queuedPresence = ((___r1 = self._pendingPresence), ___r1 == null ? null : ___r1.isa.objj_msgSend1(___r1, "valueForKey:", (theJID == null ? null : theJID.isa.objj_msgSend0(theJID, "bare")))),
00226         subscription = (aRosterItem == null ? null : aRosterItem.isa.objj_msgSend1(aRosterItem, "valueForAttribute:", "subscription"));
00227     (contact == null ? null : contact.isa.objj_msgSend1(contact, "setDelegate:", self._delegate));
00228     if ((groupNodes == null ? null : groupNodes.isa.objj_msgSend0(groupNodes, "count")))
00229     {
00230         for (var i = 0; i < (groupNodes == null ? null : groupNodes.isa.objj_msgSend0(groupNodes, "count")); i++)
00231         {
00232             var groupsLine = ((___r1 = ((___r2 = (groupNodes == null ? null : groupNodes.isa.objj_msgSend1(groupNodes, "objectAtIndex:", i))), ___r2 == null ? null : ___r2.isa.objj_msgSend0(___r2, "text"))), ___r1 == null ? null : ___r1.isa.objj_msgSend0(___r1, "uppercaseString")),
00233                 currentGroup = self.isa.objj_msgSend2(self, "groupWithPath:orCreate:", groupsLine, YES);
00234             self.isa.objj_msgSend3(self, "addContact:inGroup:push:", contact, currentGroup, NO);
00235         }
00236     }
00237     else
00238     {
00239         ((___r1 = self._content), ___r1 == null ? null : ___r1.isa.objj_msgSend1(___r1, "addObject:", contact));
00240     }
00241     for (var j = 0; j < (queuedPresence == null ? null : queuedPresence.isa.objj_msgSend0(queuedPresence, "count")); j++)
00242         (contact == null ? null : contact.isa.objj_msgSend1(contact, "_didReceivePresence:", (queuedPresence == null ? null : queuedPresence.isa.objj_msgSend1(queuedPresence, "objectAtIndex:", j))));
00243     (contact == null ? null : contact.isa.objj_msgSend1(contact, "setNickname:", nickname));
00244     (contact == null ? null : contact.isa.objj_msgSend1(contact, "setSubscription:", subscription));
00245     (contact == null ? null : contact.isa.objj_msgSend0(contact, "getMessages"));
00246     self.isa.objj_msgSend1(self, "cacheContact:", contact);
00247     return contact;
00248     var ___r1, ___r2;
00249 }
00250 ,["void","TNXMLNode"]), new objj_method(sel_getUid("_updateContactFromRosterItem:"), function $TNStropheRoster___updateContactFromRosterItem_(self, _cmd, aRosterItem)
00251 {
00252     var theJID = TNStropheJID.isa.objj_msgSend1(TNStropheJID, "stropheJIDWithString:", (aRosterItem == null ? null : aRosterItem.isa.objj_msgSend1(aRosterItem, "valueForAttribute:", "jid")));
00253     if ((theJID == null ? null : theJID.isa.objj_msgSend1(theJID, "bareEquals:", ((___r1 = self._connection), ___r1 == null ? null : ___r1.isa.objj_msgSend0(___r1, "JID")))))
00254         return;
00255     var contact = self.isa.objj_msgSend1(self, "contactWithJID:", theJID),
00256         subscription = (aRosterItem == null ? null : aRosterItem.isa.objj_msgSend1(aRosterItem, "valueForAttribute:", "subscription"));
00257     var nickname = (aRosterItem == null ? null : aRosterItem.isa.objj_msgSend1(aRosterItem, "valueForAttribute:", "name")) || nil,
00258         groupNodes = (aRosterItem == null ? null : aRosterItem.isa.objj_msgSend1(aRosterItem, "childrenWithName:", "group")),
00259         groups = CPArray.isa.objj_msgSend0(CPArray, "array"),
00260         oldGroups = ((___r1 = (contact == null ? null : contact.isa.objj_msgSend0(contact, "groups"))), ___r1 == null ? null : ___r1.isa.objj_msgSend0(___r1, "copy"));
00261     if (nickname && nickname != (contact == null ? null : contact.isa.objj_msgSend0(contact, "nickname")))
00262         (contact == null ? null : contact.isa.objj_msgSend1(contact, "setNickname:", nickname));
00263     if (((___r1 = self._content), ___r1 == null ? null : ___r1.isa.objj_msgSend1(___r1, "containsObject:", contact)))
00264         ((___r1 = self._content), ___r1 == null ? null : ___r1.isa.objj_msgSend1(___r1, "removeObject:", contact));
00265     for (var i = 0; i < (oldGroups == null ? null : oldGroups.isa.objj_msgSend0(oldGroups, "count")); i++)
00266         self.isa.objj_msgSend3(self, "removeContact:fromGroup:push:", contact, (oldGroups == null ? null : oldGroups.isa.objj_msgSend1(oldGroups, "objectAtIndex:", i)), NO);
00267     for (var i = 0; i < (groupNodes == null ? null : groupNodes.isa.objj_msgSend0(groupNodes, "count")); i++)
00268     {
00269         var currentGroupName = ((___r1 = ((___r2 = (groupNodes == null ? null : groupNodes.isa.objj_msgSend1(groupNodes, "objectAtIndex:", i))), ___r2 == null ? null : ___r2.isa.objj_msgSend0(___r2, "text"))), ___r1 == null ? null : ___r1.isa.objj_msgSend0(___r1, "uppercaseString")),
00270             currentGroup = self.isa.objj_msgSend2(self, "groupWithPath:orCreate:", currentGroupName, YES);
00271         self.isa.objj_msgSend3(self, "addContact:inGroup:push:", contact, currentGroup, NO);
00272     }
00273     if (((___r1 = (contact == null ? null : contact.isa.objj_msgSend0(contact, "groups"))), ___r1 == null ? null : ___r1.isa.objj_msgSend0(___r1, "count")) == 0)
00274         ((___r1 = self._content), ___r1 == null ? null : ___r1.isa.objj_msgSend1(___r1, "addObject:", contact));
00275     return contact;
00276     var ___r1, ___r2;
00277 }
00278 ,["void","TNXMLNode"]), new objj_method(sel_getUid("_deleteContactFromRosterItem:"), function $TNStropheRoster___deleteContactFromRosterItem_(self, _cmd, aRosterItem)
00279 {
00280     var theJID = TNStropheJID.isa.objj_msgSend1(TNStropheJID, "stropheJIDWithString:", (aRosterItem == null ? null : aRosterItem.isa.objj_msgSend1(aRosterItem, "valueForAttribute:", "jid"))),
00281         contact = self.isa.objj_msgSend1(self, "contactWithJID:", theJID),
00282         groups = (contact == null ? null : contact.isa.objj_msgSend0(contact, "groups"));
00283     if (!groups || (groups == null ? null : groups.isa.objj_msgSend0(groups, "count")) == 0)
00284         ((___r1 = self._content), ___r1 == null ? null : ___r1.isa.objj_msgSend1(___r1, "removeObject:", contact));
00285     else
00286         for (var i = 0; i < (groups == null ? null : groups.isa.objj_msgSend0(groups, "count")); i++)
00287             ((___r1 = ((___r2 = (groups == null ? null : groups.isa.objj_msgSend1(groups, "objectAtIndex:", i))), ___r2 == null ? null : ___r2.isa.objj_msgSend0(___r2, "contacts"))), ___r1 == null ? null : ___r1.isa.objj_msgSend1(___r1, "removeObject:", contact));
00288     self.isa.objj_msgSend1(self, "uncacheContact:", contact);
00289     var ___r1, ___r2;
00290 }
00291 ,["void","TNXMLNode"]), new objj_method(sel_getUid("_didReceivePresence:"), function $TNStropheRoster___didReceivePresence_(self, _cmd, aStanza)
00292 {
00293     if ((aStanza == null ? null : aStanza.isa.objj_msgSend0(aStanza, "type")) === "subscribe")
00294     {
00295         if (((___r1 = self._delegate), ___r1 == null ? null : ___r1.isa.objj_msgSend1(___r1, "respondsToSelector:", sel_getUid("roster:receiveSubscriptionRequest:"))))
00296             ((___r1 = self._delegate), ___r1 == null ? null : ___r1.isa.objj_msgSend2(___r1, "roster:receiveSubscriptionRequest:", self, aStanza));
00297         return YES;
00298     }
00299     if (self.isa.objj_msgSend1(self, "containsJID:", (aStanza == null ? null : aStanza.isa.objj_msgSend0(aStanza, "from"))))
00300         ((___r1 = self.isa.objj_msgSend1(self, "contactWithJID:", (aStanza == null ? null : aStanza.isa.objj_msgSend0(aStanza, "from")))), ___r1 == null ? null : ___r1.isa.objj_msgSend1(___r1, "_didReceivePresence:", aStanza));
00301     else
00302     {
00303         var from = (aStanza == null ? null : aStanza.isa.objj_msgSend0(aStanza, "fromBare"));
00304         if (!((___r1 = self._pendingPresence), ___r1 == null ? null : ___r1.isa.objj_msgSend1(___r1, "containsKey:", from)))
00305             ((___r1 = self._pendingPresence), ___r1 == null ? null : ___r1.isa.objj_msgSend2(___r1, "setValue:forKey:", CPArray.isa.objj_msgSend0(CPArray, "array"), from));
00306         ((___r1 = ((___r2 = self._pendingPresence), ___r2 == null ? null : ___r2.isa.objj_msgSend1(___r2, "valueForKey:", from))), ___r1 == null ? null : ___r1.isa.objj_msgSend1(___r1, "addObject:", aStanza));
00307     }
00308     return YES;
00309     var ___r1, ___r2;
00310 }
00311 ,["BOOL","TNStropheStanza"]), new objj_method(sel_getUid("groupWithPath:"), function $TNStropheRoster__groupWithPath_(self, _cmd, aPath)
00312 {
00313     var path = (aPath == null ? null : aPath.isa.objj_msgSend0(aPath, "uppercaseString")).split(TNStropheRosterRosterDelimiter),
00314         currentGroup = self.isa.objj_msgSend1(self, "rootGroupWithName:", path[0]),
00315         lastGroup = self.isa.objj_msgSend2(self, "_subGroupWithPath:relativeTo:", (path == null ? null : path.isa.objj_msgSend0(path, "copy")).splice(1, path.length - 1), currentGroup);
00316     return (lastGroup == null ? null : lastGroup.isa.objj_msgSend0(lastGroup, "path")) == aPath ? lastGroup : nil;
00317 }
00318 ,["TNStropheGroup","CPString"]), new objj_method(sel_getUid("_subGroupWithPath:relativeTo:"), function $TNStropheRoster___subGroupWithPath_relativeTo_(self, _cmd, aPath, aGroup)
00319 {
00320     var subGroup = (aGroup == null ? null : aGroup.isa.objj_msgSend1(aGroup, "subGroupWithName:", ((___r1 = aPath[0]), ___r1 == null ? null : ___r1.isa.objj_msgSend0(___r1, "uppercaseString"))));
00321     if (subGroup)
00322         return self.isa.objj_msgSend2(self, "_subGroupWithPath:relativeTo:", aPath.splice(1, aPath.length - 1), subGroup);
00323     else
00324         return aGroup;
00325     var ___r1;
00326 }
00327 ,["TNStropheGroup","CPArray","TNStropheGroup"]), new objj_method(sel_getUid("groupWithPath:orCreate:"), function $TNStropheRoster__groupWithPath_orCreate_(self, _cmd, aPath, shouldCreate)
00328 {
00329     aPath = (aPath == null ? null : aPath.isa.objj_msgSend0(aPath, "uppercaseString"));
00330     var group = self.isa.objj_msgSend1(self, "groupWithPath:", aPath);
00331     if (!group && shouldCreate)
00332     {
00333         self.isa.objj_msgSend1(self, "addGroupWithPath:", aPath);
00334         group = self.isa.objj_msgSend1(self, "groupWithPath:", aPath);
00335     }
00336     return group;
00337 }
00338 ,["TNStropheGroup","CPArray","BOOL"]), new objj_method(sel_getUid("addGroupWithPath:"), function $TNStropheRoster__addGroupWithPath_(self, _cmd, aPath)
00339 {
00340     aPath = (aPath == null ? null : aPath.isa.objj_msgSend0(aPath, "uppercaseString"));
00341     var path = (aPath == null ? null : aPath.isa.objj_msgSend0(aPath, "uppercaseString")).split(TNStropheRosterRosterDelimiter);
00342     if (self.isa.objj_msgSend1(self, "groupWithPath:", aPath))
00343         return;
00344     for (var i = 0; i < (path == null ? null : path.isa.objj_msgSend0(path, "count")); i++)
00345     {
00346         var currentPath = ((path == null ? null : path.isa.objj_msgSend0(path, "copy")).splice(0, i + 1)).join(TNStropheRosterRosterDelimiter),
00347             parentPath = ((path == null ? null : path.isa.objj_msgSend0(path, "copy")).splice(0, i)).join(TNStropheRosterRosterDelimiter),
00348             currentGroup = self.isa.objj_msgSend1(self, "groupWithPath:", currentPath),
00349             parentGroup = self.isa.objj_msgSend1(self, "groupWithPath:", parentPath);
00350         if (!currentGroup)
00351         {
00352             var tokens = (currentPath == null ? null : currentPath.isa.objj_msgSend0(currentPath, "uppercaseString")).split(TNStropheRosterRosterDelimiter),
00353                 groupName = (tokens == null ? null : tokens.isa.objj_msgSend0(tokens, "lastObject")),
00354                 currentGroup = TNStropheGroup.isa.objj_msgSend1(TNStropheGroup, "stropheGroupWithName:", groupName);
00355             ((___r1 = self._groupCache), ___r1 == null ? null : ___r1.isa.objj_msgSend1(___r1, "addObject:", currentGroup));
00356             if (parentGroup)
00357                 (parentGroup == null ? null : parentGroup.isa.objj_msgSend1(parentGroup, "addSubGroup:", currentGroup));
00358             else
00359                 ((___r1 = self._content), ___r1 == null ? null : ___r1.isa.objj_msgSend1(___r1, "addObject:", currentGroup));
00360         }
00361     }
00362     ((___r1 = CPNotificationCenter.isa.objj_msgSend0(CPNotificationCenter, "defaultCenter")), ___r1 == null ? null : ___r1.isa.objj_msgSend2(___r1, "postNotificationName:object:", TNStropheRosterGroupAddedNotification, self.isa.objj_msgSend1(self, "groupWithPath:", aPath)));
00363     var ___r1;
00364 }
00365 ,["void","CPString"]), new objj_method(sel_getUid("removeGroupWithPath:"), function $TNStropheRoster__removeGroupWithPath_(self, _cmd, aPath)
00366 {
00367     aPath = (aPath == null ? null : aPath.isa.objj_msgSend0(aPath, "uppercaseString"));
00368     var group = self.isa.objj_msgSend1(self, "groupWithPath:", aPath),
00369         parentGroup = (group == null ? null : group.isa.objj_msgSend0(group, "parentGroup"));
00370     if (!parentGroup)
00371     {
00372         (group == null ? null : group.isa.objj_msgSend0(group, "removeSubGroups"));
00373         ((___r1 = self._content), ___r1 == null ? null : ___r1.isa.objj_msgSend1(___r1, "removeObject:", group));
00374     }
00375     else
00376     {
00377         (parentGroup == null ? null : parentGroup.isa.objj_msgSend1(parentGroup, "removeSubGroup:", group));
00378     }
00379     ((___r1 = self._groupCache), ___r1 == null ? null : ___r1.isa.objj_msgSend1(___r1, "removeObject:", group));
00380     ((___r1 = CPNotificationCenter.isa.objj_msgSend0(CPNotificationCenter, "defaultCenter")), ___r1 == null ? null : ___r1.isa.objj_msgSend2(___r1, "postNotificationName:object:", TNStropheRosterGroupRemovedNotification, group));
00381     var ___r1;
00382 }
00383 ,["void","CPString"]), new objj_method(sel_getUid("removeGroup:"), function $TNStropheRoster__removeGroup_(self, _cmd, aGroup)
00384 {
00385     self.isa.objj_msgSend1(self, "removeGroupWithPath:", ((___r1 = (aGroup == null ? null : aGroup.isa.objj_msgSend0(aGroup, "path"))), ___r1 == null ? null : ___r1.isa.objj_msgSend0(___r1, "uppercaseString")));
00386     var ___r1;
00387 }
00388 ,["void","TNStropheGroup"]), new objj_method(sel_getUid("changeName:ofGroup:"), function $TNStropheRoster__changeName_ofGroup_(self, _cmd, aName, aGroup)
00389 {
00390     var affectedContacts = self.isa.objj_msgSend1(self, "getAllContactsTreeFromGroup:", aGroup);
00391     (aGroup == null ? null : aGroup.isa.objj_msgSend1(aGroup, "setName:", (aName == null ? null : aName.isa.objj_msgSend0(aName, "uppercaseString"))));
00392     self.isa.objj_msgSend1(self, "_sendRosterSet:", self.isa.objj_msgSend1(self, "getAllContactsTreeFromGroup:", aGroup));
00393     ((___r1 = CPNotificationCenter.isa.objj_msgSend0(CPNotificationCenter, "defaultCenter")), ___r1 == null ? null : ___r1.isa.objj_msgSend2(___r1, "postNotificationName:object:", TNStropheRosterGroupRenamedNotification, self));
00394     var ___r1;
00395 }
00396 ,["void","CPString","TNStropheGroup"]), new objj_method(sel_getUid("rootGroupWithName:"), function $TNStropheRoster__rootGroupWithName_(self, _cmd, aGroupName)
00397 {
00398     aGroupName = (aGroupName == null ? null : aGroupName.isa.objj_msgSend0(aGroupName, "uppercaseString"));
00399     for (var i = 0; i < ((___r1 = self._content), ___r1 == null ? null : ___r1.isa.objj_msgSend0(___r1, "count")); i++)
00400     {
00401         if (!((___r1 = ((___r2 = self._content), ___r2 == null ? null : ___r2.isa.objj_msgSend1(___r2, "objectAtIndex:", i))), ___r1 == null ? null : ___r1.isa.objj_msgSend1(___r1, "isKindOfClass:", TNStropheGroup)))
00402             continue;
00403         var group = ((___r1 = self._content), ___r1 == null ? null : ___r1.isa.objj_msgSend1(___r1, "objectAtIndex:", i));
00404         if ((group == null ? null : group.isa.objj_msgSend0(group, "name")) == aGroupName)
00405             return group;
00406     }
00407     return nil;
00408     var ___r1, ___r2;
00409 }
00410 ,["TNStropheGroup","CPString"]), new objj_method(sel_getUid("addContact:withName:inGroupWithPath:"), function $TNStropheRoster__addContact_withName_inGroupWithPath_(self, _cmd, aJID, aName, aGroupPath)
00411 {
00412     if (self.isa.objj_msgSend1(self, "containsJID:", aJID))
00413     {
00414         CPLog.warn("Cannot add JID %@. already in roster", aJID);
00415         return;
00416     }
00417     if (!aName)
00418         aName = (aJID == null ? null : aJID.isa.objj_msgSend0(aJID, "bare"));
00419     var group = aGroupPath ? self.isa.objj_msgSend2(self, "groupWithPath:orCreate:", aGroupPath, YES) : nil,
00420         contact = TNStropheContact.isa.objj_msgSend3(TNStropheContact, "contactWithConnection:JID:group:", self._connection, aJID, group);
00421     (contact == null ? null : contact.isa.objj_msgSend1(contact, "setDelegate:", self._delegate));
00422     (contact == null ? null : contact.isa.objj_msgSend1(contact, "setNickname:", aName));
00423     self.isa.objj_msgSend1(self, "_sendRosterSet:", contact);
00424 }
00425 ,["void","TNStropheJID","CPString","CPString"]), new objj_method(sel_getUid("removeContact:"), function $TNStropheRoster__removeContact_(self, _cmd, aContact)
00426 {
00427     self.isa.objj_msgSend1(self, "_sendRosterUnset:", aContact);
00428 }
00429 ,["void","TNStropheContact"]), new objj_method(sel_getUid("changeNickname:ofContact:"), function $TNStropheRoster__changeNickname_ofContact_(self, _cmd, newNickname, aContact)
00430 {
00431     var oldNickname = (aContact == null ? null : aContact.isa.objj_msgSend0(aContact, "nickname"));
00432     (aContact == null ? null : aContact.isa.objj_msgSend1(aContact, "setNickname:", newNickname));
00433     self.isa.objj_msgSend1(self, "_sendRosterSet:", aContact);
00434     ((___r1 = CPNotificationCenter.isa.objj_msgSend0(CPNotificationCenter, "defaultCenter")), ___r1 == null ? null : ___r1.isa.objj_msgSend2(___r1, "postNotificationName:object:", TNStropheContactNicknameUpdatedNotification, aContact));
00435     (aContact == null ? null : aContact.isa.objj_msgSend1(aContact, "setNickname:", oldNickname));
00436     var ___r1;
00437 }
00438 ,["void","CPString","TNStropheContact"]), new objj_method(sel_getUid("getAllContactsTreeFromGroup:"), function $TNStropheRoster__getAllContactsTreeFromGroup_(self, _cmd, aGroup)
00439 {
00440     var returnArray = CPArray.isa.objj_msgSend0(CPArray, "array");
00441     return self.isa.objj_msgSend2(self, "_getAllContactsTreeFromGroup:array:", aGroup, returnArray);
00442 }
00443 ,["CPArray","TNStropheGroup"]), new objj_method(sel_getUid("_getAllContactsTreeFromGroup:array:"), function $TNStropheRoster___getAllContactsTreeFromGroup_array_(self, _cmd, aGroup, returnArray)
00444 {
00445     var subgroups = (aGroup == null ? null : aGroup.isa.objj_msgSend0(aGroup, "subGroups"));
00446     (returnArray == null ? null : returnArray.isa.objj_msgSend1(returnArray, "addObjectsFromArray:", (aGroup == null ? null : aGroup.isa.objj_msgSend0(aGroup, "contacts"))));
00447     for (var i = 0; i < (aGroup == null ? null : aGroup.isa.objj_msgSend0(aGroup, "subGroupsCount")); i++)
00448         returnArray = self.isa.objj_msgSend2(self, "_getAllContactsTreeFromGroup:array:", ((___r1 = (aGroup == null ? null : aGroup.isa.objj_msgSend0(aGroup, "subGroups"))), ___r1 == null ? null : ___r1.isa.objj_msgSend1(___r1, "objectAtIndex:", i)), returnArray);
00449     return returnArray;
00450     var ___r1;
00451 }
00452 ,["CPArray","TNStropheGroup","CPArray"]), new objj_method(sel_getUid("addContact:inGroup:push:"), function $TNStropheRoster__addContact_inGroup_push_(self, _cmd, aContact, aGroup, shouldPush)
00453 {
00454     if (((___r1 = (aContact == null ? null : aContact.isa.objj_msgSend0(aContact, "groups"))), ___r1 == null ? null : ___r1.isa.objj_msgSend1(___r1, "containsObject:", aGroup)))
00455         return;
00456     ((___r1 = (aContact == null ? null : aContact.isa.objj_msgSend0(aContact, "groups"))), ___r1 == null ? null : ___r1.isa.objj_msgSend1(___r1, "addObject:", aGroup));
00457     ((___r1 = (aGroup == null ? null : aGroup.isa.objj_msgSend0(aGroup, "contacts"))), ___r1 == null ? null : ___r1.isa.objj_msgSend1(___r1, "addObject:", aContact));
00458     if (shouldPush)
00459     {
00460         self.isa.objj_msgSend1(self, "_sendRosterSet:", aContact);
00461         ((___r1 = (aContact == null ? null : aContact.isa.objj_msgSend0(aContact, "groups"))), ___r1 == null ? null : ___r1.isa.objj_msgSend1(___r1, "removeObject:", aGroup));
00462         ((___r1 = (aGroup == null ? null : aGroup.isa.objj_msgSend0(aGroup, "contacts"))), ___r1 == null ? null : ___r1.isa.objj_msgSend1(___r1, "removeObject:", aContact));
00463     }
00464     ((___r1 = CPNotificationCenter.isa.objj_msgSend0(CPNotificationCenter, "defaultCenter")), ___r1 == null ? null : ___r1.isa.objj_msgSend2(___r1, "postNotificationName:object:", TNStropheContactGroupUpdatedNotification, aContact));
00465     var ___r1;
00466 }
00467 ,["void","TNStropheContact","TNStropheGroup","BOOL"]), new objj_method(sel_getUid("removeContact:fromGroup:push:"), function $TNStropheRoster__removeContact_fromGroup_push_(self, _cmd, aContact, aGroup, shouldPush)
00468 {
00469     var groupsOfContact = (aContact == null ? null : aContact.isa.objj_msgSend0(aContact, "groups"));
00470     if (!(groupsOfContact == null ? null : groupsOfContact.isa.objj_msgSend1(groupsOfContact, "containsObject:", aGroup)))
00471         return;
00472     (groupsOfContact == null ? null : groupsOfContact.isa.objj_msgSend1(groupsOfContact, "removeObject:", aGroup));
00473     ((___r1 = (aGroup == null ? null : aGroup.isa.objj_msgSend0(aGroup, "contacts"))), ___r1 == null ? null : ___r1.isa.objj_msgSend1(___r1, "removeObject:", aContact));
00474     if (shouldPush)
00475     {
00476         self.isa.objj_msgSend1(self, "_sendRosterSet:", aContact);
00477         (groupsOfContact == null ? null : groupsOfContact.isa.objj_msgSend1(groupsOfContact, "addObject:", aGroup));
00478         ((___r1 = (aGroup == null ? null : aGroup.isa.objj_msgSend0(aGroup, "contacts"))), ___r1 == null ? null : ___r1.isa.objj_msgSend1(___r1, "addObject:", aContact));
00479     }
00480     ((___r1 = CPNotificationCenter.isa.objj_msgSend0(CPNotificationCenter, "defaultCenter")), ___r1 == null ? null : ___r1.isa.objj_msgSend2(___r1, "postNotificationName:object:", TNStropheContactGroupUpdatedNotification, aContact));
00481     var ___r1;
00482 }
00483 ,["void","TNStropheContact","TNStropheGroup","BOOL"]), new objj_method(sel_getUid("setGroups:ofContact:"), function $TNStropheRoster__setGroups_ofContact_(self, _cmd, someGroups, aContact)
00484 {
00485     var groupsOfContact = (aContact == null ? null : aContact.isa.objj_msgSend0(aContact, "groups")),
00486         oldGroups = (groupsOfContact == null ? null : groupsOfContact.isa.objj_msgSend0(groupsOfContact, "copy"));
00487     (aContact == null ? null : aContact.isa.objj_msgSend1(aContact, "setGroups:", someGroups || CPArray.isa.objj_msgSend0(CPArray, "array")));
00488     self.isa.objj_msgSend1(self, "_sendRosterSet:", aContact);
00489     (aContact == null ? null : aContact.isa.objj_msgSend1(aContact, "setGroups:", oldGroups));
00490 }
00491 ,["void","CPArray","TNStropheContact"]), new objj_method(sel_getUid("moveGroup:intoGroup:"), function $TNStropheRoster__moveGroup_intoGroup_(self, _cmd, aGroup, anotherGroup)
00492 {
00493     if (aGroup === anotherGroup)
00494         return;
00495     if ((aGroup == null ? null : aGroup.isa.objj_msgSend0(aGroup, "parentGroup")))
00496         ((___r1 = (aGroup == null ? null : aGroup.isa.objj_msgSend0(aGroup, "parentGroup"))), ___r1 == null ? null : ___r1.isa.objj_msgSend1(___r1, "removeSubGroup:", aGroup));
00497     else
00498         ((___r1 = self._content), ___r1 == null ? null : ___r1.isa.objj_msgSend1(___r1, "removeObject:", aGroup));
00499     if (anotherGroup)
00500         (anotherGroup == null ? null : anotherGroup.isa.objj_msgSend1(anotherGroup, "addSubGroup:", aGroup));
00501     else if (!((___r1 = self._content), ___r1 == null ? null : ___r1.isa.objj_msgSend1(___r1, "containsObject:", aGroup)))
00502         ((___r1 = self._content), ___r1 == null ? null : ___r1.isa.objj_msgSend1(___r1, "addObject:", aGroup));
00503     self.isa.objj_msgSend1(self, "_sendRosterSet:", self.isa.objj_msgSend1(self, "getAllContactsTreeFromGroup:", anotherGroup));
00504     var ___r1;
00505 }
00506 ,["void","TNStropheGroup","TNStropheGroup"]), new objj_method(sel_getUid("authorizeJID:"), function $TNStropheRoster__authorizeJID_(self, _cmd, aJID)
00507 {
00508     var contact = self.isa.objj_msgSend1(self, "contactWithJID:", aJID);
00509     if (!contact)
00510         return;
00511     (contact == null ? null : contact.isa.objj_msgSend0(contact, "subscribe"));
00512 }
00513 ,["void","TNStropheJID"]), new objj_method(sel_getUid("unauthorizeJID:"), function $TNStropheRoster__unauthorizeJID_(self, _cmd, aJID)
00514 {
00515     var contact = self.isa.objj_msgSend1(self, "contactWithJID:", aJID);
00516     if (!contact)
00517         return;
00518     (contact == null ? null : contact.isa.objj_msgSend0(contact, "unsubscribe"));
00519 }
00520 ,["void","TNStropheJID"]), new objj_method(sel_getUid("askAuthorizationTo:"), function $TNStropheRoster__askAuthorizationTo_(self, _cmd, aJID)
00521 {
00522     var contact = self.isa.objj_msgSend1(self, "contactWithJID:", aJID);
00523     if (!contact)
00524         return;
00525     (contact == null ? null : contact.isa.objj_msgSend0(contact, "askSubscription"));
00526 }
00527 ,["void","TNStropheJID"]), new objj_method(sel_getUid("answerAuthorizationRequest:answer:"), function $TNStropheRoster__answerAuthorizationRequest_answer_(self, _cmd, aStanza, theAnswer)
00528 {
00529     var requester = (aStanza == null ? null : aStanza.isa.objj_msgSend0(aStanza, "from")),
00530         nick = (aStanza == null ? null : aStanza.isa.objj_msgSend1(aStanza, "firstChildWithName:", "nick"));
00531     if (theAnswer == YES)
00532     {
00533         self.isa.objj_msgSend1(self, "authorizeJID:", requester);
00534         self.isa.objj_msgSend1(self, "askAuthorizationTo:", requester);
00535         if (!self.isa.objj_msgSend1(self, "containsJID:", requester))
00536             self.isa.objj_msgSend3(self, "addContact:withName:inGroupWithPath:", requester, nick ? (nick == null ? null : nick.isa.objj_msgSend0(nick, "text")) : (requester == null ? null : requester.isa.objj_msgSend0(requester, "bare")), nil);
00537     }
00538     else
00539         self.isa.objj_msgSend1(self, "unauthorizeJID:", requester);
00540 }
00541 ,["void","id","BOOL"])]);
00542 class_addMethods(meta_class, [new objj_method(sel_getUid("rosterWithConnection:"), function $TNStropheRoster__rosterWithConnection_(self, _cmd, aConnection)
00543 {
00544     return ((___r1 = TNStropheRoster.isa.objj_msgSend0(TNStropheRoster, "alloc")), ___r1 == null ? null : ___r1.isa.objj_msgSend1(___r1, "initWithConnection:", aConnection));
00545     var ___r1;
00546 }
00547 ,["id","TNStropheConnection"])]);
00548 }
 All Classes Namespaces Files Functions Variables