StropheCappuccino API 1.0.0
/tmp/tempDoc.doc/Build/StropheCappuccino.build/Release/Browser.environment/Sources/TNStropheClient.j
Go to the documentation of this file.
00001 @STATIC;1.0;I;23;Foundation/Foundation.jI;16;AppKit/CPImage.ji;28;Resources/Strophe/strophe.jsi;21;TNStropheConnection.ji;14;TNStropheJID.ji;17;TNStropheStanza.ji;11;TNXMLNode.ji;16;TNStropheVCard.jt;29372;objj_executeFile("Foundation/Foundation.j", NO);objj_executeFile("AppKit/CPImage.j", NO);objj_executeFile("Resources/Strophe/strophe.js", YES);objj_executeFile("TNStropheConnection.j", YES);objj_executeFile("TNStropheJID.j", YES);objj_executeFile("TNStropheStanza.j", YES);objj_executeFile("TNXMLNode.j", YES);objj_executeFile("TNStropheVCard.j", YES);TNStropheClientPasswordChangedNotification = "TNStropheClientPasswordChangedNotification";
00002 TNStropheClientPasswordChangeErrorNotification = "TNStropheClientPasswordChangeErrorNotification";
00003 TNStropheClientPresenceUpdatedNotification = "TNStropheClientPresenceUpdatedNotification";
00004 TNStropheClientVCardReceivedNotification = "TNStropheClientVCardReceivedNotification";
00005 {var the_class = objj_allocateClassPair(CPObject, "TNStropheClient"),
00006 meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_features"), new objj_ivar("_clientNode"), new objj_ivar("_identityCategory"), new objj_ivar("_identityName"), new objj_ivar("_identityType"), new objj_ivar("_password"), new objj_ivar("_delegate"), new objj_ivar("_connection"), new objj_ivar("_JID"), new objj_ivar("_vCard"), new objj_ivar("_avatar"), new objj_ivar("_userPresenceShow"), new objj_ivar("_userPresenceStatus")]);objj_registerClassPair(the_class);
00007 class_addMethods(the_class, [new objj_method(sel_getUid("_features"), function $TNStropheClient___features(self, _cmd)
00008 {
00009     return self._features;
00010 }
00011 ,["CPArray"]), new objj_method(sel_getUid("clientNode"), function $TNStropheClient__clientNode(self, _cmd)
00012 {
00013     return self._clientNode;
00014 }
00015 ,["CPString"]), new objj_method(sel_getUid("setClientNode:"), function $TNStropheClient__setClientNode_(self, _cmd, newValue)
00016 {
00017     self._clientNode = newValue;
00018 }
00019 ,["void","CPString"]), new objj_method(sel_getUid("identityCategory"), function $TNStropheClient__identityCategory(self, _cmd)
00020 {
00021     return self._identityCategory;
00022 }
00023 ,["CPString"]), new objj_method(sel_getUid("setIdentityCategory:"), function $TNStropheClient__setIdentityCategory_(self, _cmd, newValue)
00024 {
00025     self._identityCategory = newValue;
00026 }
00027 ,["void","CPString"]), new objj_method(sel_getUid("identityName"), function $TNStropheClient__identityName(self, _cmd)
00028 {
00029     return self._identityName;
00030 }
00031 ,["CPString"]), new objj_method(sel_getUid("setIdentityName:"), function $TNStropheClient__setIdentityName_(self, _cmd, newValue)
00032 {
00033     self._identityName = newValue;
00034 }
00035 ,["void","CPString"]), new objj_method(sel_getUid("identityType"), function $TNStropheClient__identityType(self, _cmd)
00036 {
00037     return self._identityType;
00038 }
00039 ,["CPString"]), new objj_method(sel_getUid("setIdentityType:"), function $TNStropheClient__setIdentityType_(self, _cmd, newValue)
00040 {
00041     self._identityType = newValue;
00042 }
00043 ,["void","CPString"]), new objj_method(sel_getUid("password"), function $TNStropheClient__password(self, _cmd)
00044 {
00045     return self._password;
00046 }
00047 ,["CPString"]), new objj_method(sel_getUid("setPassword:"), function $TNStropheClient__setPassword_(self, _cmd, newValue)
00048 {
00049     self._password = newValue;
00050 }
00051 ,["void","CPString"]), new objj_method(sel_getUid("delegate"), function $TNStropheClient__delegate(self, _cmd)
00052 {
00053     return self._delegate;
00054 }
00055 ,["id"]), new objj_method(sel_getUid("setDelegate:"), function $TNStropheClient__setDelegate_(self, _cmd, newValue)
00056 {
00057     self._delegate = newValue;
00058 }
00059 ,["void","id"]), new objj_method(sel_getUid("connection"), function $TNStropheClient__connection(self, _cmd)
00060 {
00061     return self._connection;
00062 }
00063 ,["TNStropheConnection"]), new objj_method(sel_getUid("setConnection:"), function $TNStropheClient__setConnection_(self, _cmd, newValue)
00064 {
00065     self._connection = newValue;
00066 }
00067 ,["void","TNStropheConnection"]), new objj_method(sel_getUid("JID"), function $TNStropheClient__JID(self, _cmd)
00068 {
00069     return self._JID;
00070 }
00071 ,["TNStropheJID"]), new objj_method(sel_getUid("setJID:"), function $TNStropheClient__setJID_(self, _cmd, newValue)
00072 {
00073     self._JID = newValue;
00074 }
00075 ,["void","TNStropheJID"]), new objj_method(sel_getUid("vCard"), function $TNStropheClient__vCard(self, _cmd)
00076 {
00077     return self._vCard;
00078 }
00079 ,["TNStropheVCard"]), new objj_method(sel_getUid("_setVCard:"), function $TNStropheClient___setVCard_(self, _cmd, newValue)
00080 {
00081     self._vCard = newValue;
00082 }
00083 ,["void","TNStropheVCard"]), new objj_method(sel_getUid("avatar"), function $TNStropheClient__avatar(self, _cmd)
00084 {
00085     return self._avatar;
00086 }
00087 ,["CPImage"]), new objj_method(sel_getUid("_setAvatar:"), function $TNStropheClient___setAvatar_(self, _cmd, newValue)
00088 {
00089     self._avatar = newValue;
00090 }
00091 ,["void","CPImage"]), new objj_method(sel_getUid("initWithService:"), function $TNStropheClient__initWithService_(self, _cmd, aService)
00092 {
00093     if (self = objj_msgSendSuper({ receiver:self, super_class:objj_getClass("TNStropheClient").super_class }, "init"))
00094     {
00095         self._connection = TNStropheConnection.isa.objj_msgSend2(TNStropheConnection, "connectionWithService:andDelegate:", aService, self);
00096         self._userPresenceShow = TNStropheContactStatusOffline;
00097         self._userPresenceStatus = "";
00098         self._clientNode = "http://cappuccino.org";
00099         self._identityCategory = "client";
00100         self._identityName = "StropheCappuccino";
00101         self._identityType = "web";
00102         self._features = [Strophe.NS.CAPS, Strophe.NS.DISCO_INFO, Strophe.NS.DISCO_ITEMS];
00103     }
00104     return self;
00105 }
00106 ,["id","CPString"]), new objj_method(sel_getUid("initWithService:JID:password:"), function $TNStropheClient__initWithService_JID_password_(self, _cmd, aService, aJID, aPassword)
00107 {
00108     if (self = (self == null ? null : self.isa.objj_msgSend1(self, "initWithService:", aService)))
00109     {
00110         self._JID = aJID;
00111         self._password = aPassword;
00112     }
00113     return self;
00114 }
00115 ,["id","CPString","TNStropheJID","CPString"]), new objj_method(sel_getUid("connect"), function $TNStropheClient__connect(self, _cmd)
00116 {
00117     var pingDict = CPDictionary.isa.objj_msgSend(CPDictionary, "dictionaryWithObjectsAndKeys:", "iq", "name", "get", "type");
00118     ((___r1 = self._connection), ___r1 == null ? null : ___r1.isa.objj_msgSend3(___r1, "registerSelector:ofObject:withDict:", sel_getUid("_didReceivePing:"), self, pingDict));
00119     ((___r1 = self._connection), ___r1 == null ? null : ___r1.isa.objj_msgSend2(___r1, "connectWithJID:andPassword:", self._JID, self._password));
00120     var ___r1;
00121 }
00122 ,["void"]), new objj_method(sel_getUid("disconnect"), function $TNStropheClient__disconnect(self, _cmd)
00123 {
00124     ((___r1 = self._connection), ___r1 == null ? null : ___r1.isa.objj_msgSend0(___r1, "disconnect"));
00125     var ___r1;
00126 }
00127 ,["void"]), new objj_method(sel_getUid("onStropheConnecting:"), function $TNStropheClient__onStropheConnecting_(self, _cmd, aConnection)
00128 {
00129     if (((___r1 = self._delegate), ___r1 == null ? null : ___r1.isa.objj_msgSend1(___r1, "respondsToSelector:", sel_getUid("onStropheConnecting:"))))
00130         ((___r1 = self._delegate), ___r1 == null ? null : ___r1.isa.objj_msgSend1(___r1, "onStropheConnecting:", self));
00131     var ___r1;
00132 }
00133 ,["void","TNStropheConnection"]), new objj_method(sel_getUid("onStropheConnected:"), function $TNStropheClient__onStropheConnected_(self, _cmd, aConnection)
00134 {
00135     self.isa.objj_msgSend0(self, "_sendCAPS");
00136     if (((___r1 = self._delegate), ___r1 == null ? null : ___r1.isa.objj_msgSend1(___r1, "respondsToSelector:", sel_getUid("onStropheConnected:"))))
00137         ((___r1 = self._delegate), ___r1 == null ? null : ___r1.isa.objj_msgSend1(___r1, "onStropheConnected:", self));
00138     var ___r1;
00139 }
00140 ,["void","TNStropheConnection"]), new objj_method(sel_getUid("onStropheConnectFail:"), function $TNStropheClient__onStropheConnectFail_(self, _cmd, aConnection)
00141 {
00142     if (((___r1 = self._delegate), ___r1 == null ? null : ___r1.isa.objj_msgSend1(___r1, "respondsToSelector:", sel_getUid("onStropheConnectFail:"))))
00143         ((___r1 = self._delegate), ___r1 == null ? null : ___r1.isa.objj_msgSend1(___r1, "onStropheConnectFail:", self));
00144     var ___r1;
00145 }
00146 ,["void","TNStropheConnection"]), new objj_method(sel_getUid("onStropheDisconnecting:"), function $TNStropheClient__onStropheDisconnecting_(self, _cmd, aConnection)
00147 {
00148     if (((___r1 = self._delegate), ___r1 == null ? null : ___r1.isa.objj_msgSend1(___r1, "respondsToSelector:", sel_getUid("onStropheDisconnecting:"))))
00149         ((___r1 = self._delegate), ___r1 == null ? null : ___r1.isa.objj_msgSend1(___r1, "onStropheDisconnecting:", self));
00150     var ___r1;
00151 }
00152 ,["void","TNStropheConnection"]), new objj_method(sel_getUid("onStropheDisconnected:"), function $TNStropheClient__onStropheDisconnected_(self, _cmd, aConnection)
00153 {
00154     self._userPresenceShow = TNStropheContactStatusOffline;
00155     self._userPresenceStatus = "";
00156     if (((___r1 = self._delegate), ___r1 == null ? null : ___r1.isa.objj_msgSend1(___r1, "respondsToSelector:", sel_getUid("onStropheDisconnected:"))))
00157         ((___r1 = self._delegate), ___r1 == null ? null : ___r1.isa.objj_msgSend1(___r1, "onStropheDisconnected:", self));
00158     var ___r1;
00159 }
00160 ,["void","TNStropheConnection"]), new objj_method(sel_getUid("onStropheAuthenticating:"), function $TNStropheClient__onStropheAuthenticating_(self, _cmd, aConnection)
00161 {
00162     if (((___r1 = self._delegate), ___r1 == null ? null : ___r1.isa.objj_msgSend1(___r1, "respondsToSelector:", sel_getUid("onStropheAuthenticating:"))))
00163         ((___r1 = self._delegate), ___r1 == null ? null : ___r1.isa.objj_msgSend1(___r1, "onStropheAuthenticating:", self));
00164     var ___r1;
00165 }
00166 ,["void","TNStropheConnection"]), new objj_method(sel_getUid("onStropheAuthFail:"), function $TNStropheClient__onStropheAuthFail_(self, _cmd, aConnection)
00167 {
00168     if (((___r1 = self._delegate), ___r1 == null ? null : ___r1.isa.objj_msgSend1(___r1, "respondsToSelector:", sel_getUid("onStropheAuthFail:"))))
00169         ((___r1 = self._delegate), ___r1 == null ? null : ___r1.isa.objj_msgSend1(___r1, "onStropheAuthFail:", self));
00170     var ___r1;
00171 }
00172 ,["void","TNStropheConnection"]), new objj_method(sel_getUid("onStropheError:"), function $TNStropheClient__onStropheError_(self, _cmd, aConnection)
00173 {
00174     if (((___r1 = self._delegate), ___r1 == null ? null : ___r1.isa.objj_msgSend1(___r1, "respondsToSelector:", sel_getUid("onStropheError:"))))
00175         ((___r1 = self._delegate), ___r1 == null ? null : ___r1.isa.objj_msgSend1(___r1, "onStropheError:", self));
00176     var ___r1;
00177 }
00178 ,["void","TNStropheConnection"]), new objj_method(sel_getUid("connection:errorCondition:"), function $TNStropheClient__connection_errorCondition_(self, _cmd, aConnection, anErrorCondition)
00179 {
00180     if (((___r1 = self._delegate), ___r1 == null ? null : ___r1.isa.objj_msgSend1(___r1, "respondsToSelector:", sel_getUid("client:errorCondition:"))))
00181         ((___r1 = self._delegate), ___r1 == null ? null : ___r1.isa.objj_msgSend2(___r1, "client:errorCondition:", self, anErrorCondition));
00182     var ___r1;
00183 }
00184 ,["void","TNStropheConnection","CPString"]), new objj_method(sel_getUid("_sendInitialPresence"), function $TNStropheClient___sendInitialPresence(self, _cmd)
00185 {
00186     var presenceHandleParams = CPDictionary.isa.objj_msgSend(CPDictionary, "dictionaryWithObjectsAndKeys:", "presence", "name", ((___r1 = self._JID), ___r1 == null ? null : ___r1.isa.objj_msgSend0(___r1, "bare")), "from", {"matchBare": true}, "options");
00187     ((___r1 = self._connection), ___r1 == null ? null : ___r1.isa.objj_msgSend3(___r1, "registerSelector:ofObject:withDict:", sel_getUid("_didPresenceUpdate:"), self, presenceHandleParams));
00188     self.isa.objj_msgSend2(self, "setPresenceShow:status:", TNStropheContactStatusOnline, "");
00189     var ___r1;
00190 }
00191 ,["void"]), new objj_method(sel_getUid("_didReceivePing:"), function $TNStropheClient___didReceivePing_(self, _cmd, aStanza)
00192 {
00193     if ((aStanza == null ? null : aStanza.isa.objj_msgSend1(aStanza, "containsChildrenWithName:", "ping")) && ((___r1 = (aStanza == null ? null : aStanza.isa.objj_msgSend1(aStanza, "firstChildWithName:", "ping"))), ___r1 == null ? null : ___r1.isa.objj_msgSend0(___r1, "namespace")) == Strophe.NS.PING)
00194     {
00195         CPLog.debug("Ping received. Sending pong.");
00196         ((___r1 = self._connection), ___r1 == null ? null : ___r1.isa.objj_msgSend1(___r1, "send:", TNStropheStanza.isa.objj_msgSend1(TNStropheStanza, "iqWithAttributes:", {'to': ((___r2 = (aStanza == null ? null : aStanza.isa.objj_msgSend0(aStanza, "from"))), ___r2 == null ? null : ___r2.isa.objj_msgSend0(___r2, "bare")), 'id': (aStanza == null ? null : aStanza.isa.objj_msgSend0(aStanza, "ID")), 'type': 'result'})));
00197     }
00198     return YES;
00199     var ___r1, ___r2;
00200 }
00201 ,["BOOL","TNStropheStanza"]), new objj_method(sel_getUid("addFeature:"), function $TNStropheClient__addFeature_(self, _cmd, aFeatureNamespace)
00202 {
00203     ((___r1 = self._features), ___r1 == null ? null : ___r1.isa.objj_msgSend1(___r1, "addObject:", aFeatureNamespace));
00204     var ___r1;
00205 }
00206 ,["void","CPString"]), new objj_method(sel_getUid("removeFeature:"), function $TNStropheClient__removeFeature_(self, _cmd, aFeatureNamespace)
00207 {
00208     ((___r1 = self._features), ___r1 == null ? null : ___r1.isa.objj_msgSend1(___r1, "removeObjectIdenticalTo:", aFeatureNamespace));
00209     var ___r1;
00210 }
00211 ,["void","CPString"]), new objj_method(sel_getUid("_clientVer"), function $TNStropheClient___clientVer(self, _cmd)
00212 {
00213     return SHA1.b64_sha1(self._features.join());
00214 }
00215 ,["CPString"]), new objj_method(sel_getUid("_sendCAPS"), function $TNStropheClient___sendCAPS(self, _cmd)
00216 {
00217     var caps = TNStropheStanza.isa.objj_msgSend0(TNStropheStanza, "presence");
00218     (caps == null ? null : caps.isa.objj_msgSend2(caps, "addChildWithName:andAttributes:", "c", {"xmlns": Strophe.NS.CAPS, "node": self._clientNode, "hash": "sha-1", "ver": self.isa.objj_msgSend0(self, "_clientVer")}));
00219     ((___r1 = self._connection), ___r1 == null ? null : ___r1.isa.objj_msgSend3(___r1, "registerSelector:ofObject:withDict:", sel_getUid("handleFeaturesDisco:"), self, CPDictionary.isa.objj_msgSend(CPDictionary, "dictionaryWithObjectsAndKeys:", "iq", "name", "get", "type", Strophe.NS.DISCO_INFO, "namespace")));
00220     ((___r1 = self._connection), ___r1 == null ? null : ___r1.isa.objj_msgSend1(___r1, "send:", caps));
00221     var ___r1;
00222 }
00223 ,["void"]), new objj_method(sel_getUid("handleFeaturesDisco:"), function $TNStropheClient__handleFeaturesDisco_(self, _cmd, aStanza)
00224 {
00225     var resp = TNStropheStanza.isa.objj_msgSend1(TNStropheStanza, "iqWithAttributes:", {"id": ((___r1 = self._connection), ___r1 == null ? null : ___r1.isa.objj_msgSend0(___r1, "getUniqueId")), "type": "result"});
00226     (resp == null ? null : resp.isa.objj_msgSend1(resp, "setTo:", (aStanza == null ? null : aStanza.isa.objj_msgSend0(aStanza, "from"))));
00227     (resp == null ? null : resp.isa.objj_msgSend2(resp, "addChildWithName:andAttributes:", "query", {"xmlns": Strophe.NS.DISCO_INFO, "node": self._clientNode + '#' + self.isa.objj_msgSend0(self, "_clientVer")}));
00228     (resp == null ? null : resp.isa.objj_msgSend2(resp, "addChildWithName:andAttributes:", "identity", {"category": self._identityCategory, "name": self._identityName, "type": self._identityType}));
00229     (resp == null ? null : resp.isa.objj_msgSend0(resp, "up"));
00230     for (var i = 0; i < ((___r1 = self._features), ___r1 == null ? null : ___r1.isa.objj_msgSend0(___r1, "count")); i++)
00231     {
00232         (resp == null ? null : resp.isa.objj_msgSend2(resp, "addChildWithName:andAttributes:", "feature", {"var": ((___r1 = self._features), ___r1 == null ? null : ___r1.isa.objj_msgSend1(___r1, "objectAtIndex:", i))}));
00233         (resp == null ? null : resp.isa.objj_msgSend0(resp, "up"));
00234     }
00235     ((___r1 = self._connection), ___r1 == null ? null : ___r1.isa.objj_msgSend1(___r1, "send:", resp));
00236     return YES;
00237     var ___r1;
00238 }
00239 ,["BOOL","TNStropheStanza"]), new objj_method(sel_getUid("publishPEPPayload:toNode:"), function $TNStropheClient__publishPEPPayload_toNode_(self, _cmd, aPayload, aNode)
00240 {
00241     var uid = ((___r1 = self._connection), ___r1 == null ? null : ___r1.isa.objj_msgSend0(___r1, "getUniqueId")),
00242         stanza = TNStropheStanza.isa.objj_msgSend1(TNStropheStanza, "iqWithAttributes:", {"type": "set", "id": uid}),
00243         params = CPDictionary.isa.objj_msgSend2(CPDictionary, "dictionaryWithObject:forKey:", uid, "id");
00244     (stanza == null ? null : stanza.isa.objj_msgSend2(stanza, "addChildWithName:andAttributes:", "pubsub", {"xmlns": Strophe.NS.PUBSUB}));
00245     (stanza == null ? null : stanza.isa.objj_msgSend2(stanza, "addChildWithName:andAttributes:", "publish", {"node": aNode}));
00246     (stanza == null ? null : stanza.isa.objj_msgSend1(stanza, "addChildWithName:", "item"));
00247     (stanza == null ? null : stanza.isa.objj_msgSend1(stanza, "addNode:", aPayload));
00248     ((___r1 = self._connection), ___r1 == null ? null : ___r1.isa.objj_msgSend3(___r1, "registerSelector:ofObject:withDict:", sel_getUid("_didPublishPEP:"), self, params));
00249     ((___r1 = self._connection), ___r1 == null ? null : ___r1.isa.objj_msgSend1(___r1, "send:", stanza));
00250     var ___r1;
00251 }
00252 ,["void","TNXMLNode","CPString"]), new objj_method(sel_getUid("_didPublishPEP:"), function $TNStropheClient___didPublishPEP_(self, _cmd, aStanza)
00253 {
00254     if ((aStanza == null ? null : aStanza.isa.objj_msgSend0(aStanza, "type")) == "result")
00255         CPLog.debug("Publish succeeded!");
00256     else
00257         CPLog.error("Cannot publish the pubsub item:" + (aStanza == null ? null : aStanza.isa.objj_msgSend0(aStanza, "stringValue")));
00258     return NO;
00259 }
00260 ,["void","TNStropheStanza"]), new objj_method(sel_getUid("setPresenceShow:status:"), function $TNStropheClient__setPresenceShow_status_(self, _cmd, aPresenceShow, aStatus)
00261 {
00262     if (aPresenceShow === self._userPresenceShow && aStatus === self._userPresenceStatus)
00263         return;
00264     var presence = TNStropheStanza.isa.objj_msgSend0(TNStropheStanza, "presence");
00265     self._userPresenceShow = aPresenceShow || self._userPresenceShow;
00266     self._userPresenceStatus = aStatus || self._userPresenceStatus;
00267     (presence == null ? null : presence.isa.objj_msgSend1(presence, "addChildWithName:", "status"));
00268     (presence == null ? null : presence.isa.objj_msgSend1(presence, "addTextNode:", self._userPresenceStatus));
00269     (presence == null ? null : presence.isa.objj_msgSend0(presence, "up"));
00270     (presence == null ? null : presence.isa.objj_msgSend1(presence, "addChildWithName:", "show"));
00271     (presence == null ? null : presence.isa.objj_msgSend1(presence, "addTextNode:", self._userPresenceShow));
00272     ((___r1 = self._connection), ___r1 == null ? null : ___r1.isa.objj_msgSend1(___r1, "send:", presence));
00273     var ___r1;
00274 }
00275 ,["void","CPString","CPString"]), new objj_method(sel_getUid("_didPresenceUpdate:"), function $TNStropheClient___didPresenceUpdate_(self, _cmd, aStanza)
00276 {
00277     var shouldNotify = NO;
00278     if ((aStanza == null ? null : aStanza.isa.objj_msgSend1(aStanza, "firstChildWithName:", "show")))
00279     {
00280         self._userPresenceShow = ((___r1 = (aStanza == null ? null : aStanza.isa.objj_msgSend1(aStanza, "firstChildWithName:", "show"))), ___r1 == null ? null : ___r1.isa.objj_msgSend0(___r1, "text"));
00281         shouldNotify = YES;
00282     }
00283     if ((aStanza == null ? null : aStanza.isa.objj_msgSend1(aStanza, "firstChildWithName:", "status")))
00284     {
00285         self._userPresenceStatus = ((___r1 = (aStanza == null ? null : aStanza.isa.objj_msgSend1(aStanza, "firstChildWithName:", "status"))), ___r1 == null ? null : ___r1.isa.objj_msgSend0(___r1, "text"));
00286         shouldNotify = YES;
00287     }
00288     if (shouldNotify)
00289     {
00290         var presenceInformation = CPDictionary.isa.objj_msgSend(CPDictionary, "dictionaryWithObjectsAndKeys:", self._userPresenceShow, "show", self._userPresenceStatus, "status");
00291         ((___r1 = CPNotificationCenter.isa.objj_msgSend0(CPNotificationCenter, "defaultCenter")), ___r1 == null ? null : ___r1.isa.objj_msgSend3(___r1, "postNotificationName:object:userInfo:", TNStropheClientPresenceUpdatedNotification, self, presenceInformation));
00292     }
00293     return YES;
00294     var ___r1;
00295 }
00296 ,["BOOL","TNStropheStanza"]), new objj_method(sel_getUid("getVCard"), function $TNStropheClient__getVCard(self, _cmd)
00297 {
00298     var uid = ((___r1 = self._connection), ___r1 == null ? null : ___r1.isa.objj_msgSend0(___r1, "getUniqueId")),
00299         vcardStanza = TNStropheStanza.isa.objj_msgSend1(TNStropheStanza, "iqWithAttributes:", {"type": "get", "id": uid}),
00300         params = CPDictionary.isa.objj_msgSend2(CPDictionary, "dictionaryWithObjectsAndKeys:", uid, "id");
00301     (vcardStanza == null ? null : vcardStanza.isa.objj_msgSend2(vcardStanza, "addChildWithName:andAttributes:", "vCard", {"xmlns": "vcard-temp"}));
00302     ((___r1 = self._connection), ___r1 == null ? null : ___r1.isa.objj_msgSend3(___r1, "registerSelector:ofObject:withDict:", sel_getUid("_didReceiveCurrentUserVCard:"), self, params));
00303     ((___r1 = self._connection), ___r1 == null ? null : ___r1.isa.objj_msgSend1(___r1, "send:", vcardStanza));
00304     var ___r1;
00305 }
00306 ,["void"]), new objj_method(sel_getUid("_didReceiveCurrentUserVCard:"), function $TNStropheClient___didReceiveCurrentUserVCard_(self, _cmd, aStanza)
00307 {
00308     if ((aStanza == null ? null : aStanza.isa.objj_msgSend0(aStanza, "type")) == "result")
00309     {
00310         self._vCard = ((___r1 = TNStropheVCard.isa.objj_msgSend0(TNStropheVCard, "alloc")), ___r1 == null ? null : ___r1.isa.objj_msgSend1(___r1, "initWithXMLNode:", (aStanza == null ? null : aStanza.isa.objj_msgSend1(aStanza, "firstChildWithName:", "vCard"))));
00311         self._avatar = ((___r1 = self._vCard), ___r1 == null ? null : ___r1.isa.objj_msgSend0(___r1, "photo"));
00312     }
00313     ((___r1 = CPNotificationCenter.isa.objj_msgSend0(CPNotificationCenter, "defaultCenter")), ___r1 == null ? null : ___r1.isa.objj_msgSend3(___r1, "postNotificationName:object:userInfo:", TNStropheClientVCardReceivedNotification, self, aStanza));
00314     return YES;
00315     var ___r1;
00316 }
00317 ,["BOOL","TNStropheStanza"]), new objj_method(sel_getUid("setVCard:object:selector:userInfo:"), function $TNStropheClient__setVCard_object_selector_userInfo_(self, _cmd, aVCard, anObject, aSelector, someUserInfo)
00318 {
00319     var uid = ((___r1 = self._connection), ___r1 == null ? null : ___r1.isa.objj_msgSend0(___r1, "getUniqueId")),
00320         stanza = TNStropheStanza.isa.objj_msgSend1(TNStropheStanza, "iqWithAttributes:", {"id": uid, "type": "set"}),
00321         params = CPDictionary.isa.objj_msgSend2(CPDictionary, "dictionaryWithObjectsAndKeys:", uid, "id");
00322     self._vCard = aVCard;
00323     (stanza == null ? null : stanza.isa.objj_msgSend1(stanza, "addNode:", ((___r1 = self._vCard), ___r1 == null ? null : ___r1.isa.objj_msgSend0(___r1, "XMLNode"))));
00324     ((___r1 = self._connection), ___r1 == null ? null : ___r1.isa.objj_msgSend3(___r1, "registerSelector:ofObject:withDict:", sel_getUid("notifyVCardUpdate:"), self, params));
00325     ((___r1 = self._connection), ___r1 == null ? null : ___r1.isa.objj_msgSend(___r1, "registerSelector:ofObject:withDict:userInfo:", aSelector, anObject, params, someUserInfo));
00326     ((___r1 = self._connection), ___r1 == null ? null : ___r1.isa.objj_msgSend1(___r1, "send:", stanza));
00327     var ___r1;
00328 }
00329 ,["void","TNXMLNode","CPObject","SEL","id"]), new objj_method(sel_getUid("notifyVCardUpdate:"), function $TNStropheClient__notifyVCardUpdate_(self, _cmd, aStanza)
00330 {
00331     var uid = ((___r1 = self._connection), ___r1 == null ? null : ___r1.isa.objj_msgSend0(___r1, "getUniqueId")),
00332         stanza = TNStropheStanza.isa.objj_msgSend1(TNStropheStanza, "presenceWithAttributes:", {"id": uid}),
00333         params = CPDictionary.isa.objj_msgSend2(CPDictionary, "dictionaryWithObjectsAndKeys:", uid, "id");
00334     (stanza == null ? null : stanza.isa.objj_msgSend1(stanza, "addChildWithName:", "status"));
00335     (stanza == null ? null : stanza.isa.objj_msgSend1(stanza, "addTextNode:", self._userPresenceStatus));
00336     (stanza == null ? null : stanza.isa.objj_msgSend0(stanza, "up"));
00337     (stanza == null ? null : stanza.isa.objj_msgSend1(stanza, "addChildWithName:", "show"));
00338     (stanza == null ? null : stanza.isa.objj_msgSend1(stanza, "addTextNode:", self._userPresenceShow));
00339     (stanza == null ? null : stanza.isa.objj_msgSend0(stanza, "up"));
00340     (stanza == null ? null : stanza.isa.objj_msgSend2(stanza, "addChildWithName:andAttributes:", "x", {"xmlns": "vcard-temp:x:update"}));
00341     ((___r1 = self._connection), ___r1 == null ? null : ___r1.isa.objj_msgSend1(___r1, "send:", stanza));
00342     var ___r1;
00343 }
00344 ,["void","TNStropheStanza"]), new objj_method(sel_getUid("_didNotifyVCardUpdate:"), function $TNStropheClient___didNotifyVCardUpdate_(self, _cmd, aStanza)
00345 {
00346     CPLog.trace((aStanza == null ? null : aStanza.isa.objj_msgSend0(aStanza, "stringValue")));
00347 }
00348 ,["void","TNStropheStanza"]), new objj_method(sel_getUid("changePassword:"), function $TNStropheClient__changePassword_(self, _cmd, aPassword)
00349 {
00350     var uid = ((___r1 = self._connection), ___r1 == null ? null : ___r1.isa.objj_msgSend0(___r1, "getUniqueId")),
00351         stanza = TNStropheStanza.isa.objj_msgSend1(TNStropheStanza, "iqWithAttributes:", {"id": uid, "type": "set"}),
00352         params = CPDictionary.isa.objj_msgSend2(CPDictionary, "dictionaryWithObjectsAndKeys:", uid, "id");
00353     (stanza == null ? null : stanza.isa.objj_msgSend2(stanza, "addChildWithName:andAttributes:", "query", {"xmlns": "jabber:iq:register"}));
00354     (stanza == null ? null : stanza.isa.objj_msgSend1(stanza, "addChildWithName:", "username"));
00355     (stanza == null ? null : stanza.isa.objj_msgSend1(stanza, "addTextNode:", ((___r1 = ((___r2 = self._connection), ___r2 == null ? null : ___r2.isa.objj_msgSend0(___r2, "JID"))), ___r1 == null ? null : ___r1.isa.objj_msgSend0(___r1, "node"))));
00356     (stanza == null ? null : stanza.isa.objj_msgSend0(stanza, "up"));
00357     (stanza == null ? null : stanza.isa.objj_msgSend1(stanza, "addChildWithName:", "password"));
00358     (stanza == null ? null : stanza.isa.objj_msgSend1(stanza, "addTextNode:", aPassword));
00359     (stanza == null ? null : stanza.isa.objj_msgSend0(stanza, "up"));
00360     ((___r1 = self._connection), ___r1 == null ? null : ___r1.isa.objj_msgSend3(___r1, "registerSelector:ofObject:withDict:", sel_getUid("_didChangePassword:"), self, params));
00361     ((___r1 = self._connection), ___r1 == null ? null : ___r1.isa.objj_msgSend1(___r1, "send:", stanza));
00362     var ___r1, ___r2;
00363 }
00364 ,["void","CPString"]), new objj_method(sel_getUid("_didChangePassword:"), function $TNStropheClient___didChangePassword_(self, _cmd, aStanza)
00365 {
00366     if ((aStanza == null ? null : aStanza.isa.objj_msgSend0(aStanza, "type")) == "result")
00367         ((___r1 = CPNotificationCenter.isa.objj_msgSend0(CPNotificationCenter, "defaultCenter")), ___r1 == null ? null : ___r1.isa.objj_msgSend3(___r1, "postNotificationName:object:userInfo:", TNStropheClientPasswordChangedNotification, self, aStanza));
00368     else
00369         ((___r1 = CPNotificationCenter.isa.objj_msgSend0(CPNotificationCenter, "defaultCenter")), ___r1 == null ? null : ___r1.isa.objj_msgSend3(___r1, "postNotificationName:object:userInfo:", TNStropheClientPasswordChangeErrorNotification, self, aStanza));
00370     var ___r1;
00371 }
00372 ,["void","TNStropheStanza"])]);
00373 class_addMethods(meta_class, [new objj_method(sel_getUid("addNamespaceWithName:value:"), function $TNStropheClient__addNamespaceWithName_value_(self, _cmd, aName, aValue)
00374 {
00375     Strophe.addNamespace(aName, aValue);
00376 }
00377 ,["void","CPString","CPString"]), new objj_method(sel_getUid("clientWithService:"), function $TNStropheClient__clientWithService_(self, _cmd, aService)
00378 {
00379     return ((___r1 = TNStropheClient.isa.objj_msgSend0(TNStropheClient, "alloc")), ___r1 == null ? null : ___r1.isa.objj_msgSend1(___r1, "initWithService:", aService));
00380     var ___r1;
00381 }
00382 ,["TNStropheClient","CPString"]), new objj_method(sel_getUid("clientWithService:JID:password:"), function $TNStropheClient__clientWithService_JID_password_(self, _cmd, aService, aJID, aPassword)
00383 {
00384     return ((___r1 = TNStropheClient.isa.objj_msgSend0(TNStropheClient, "alloc")), ___r1 == null ? null : ___r1.isa.objj_msgSend3(___r1, "initWithService:JID:password:", aService, aJID, aPassword));
00385     var ___r1;
00386 }
00387 ,["TNStropheClient","CPString","TNStropheJID","CPString"])]);
00388 }{
00389 var the_class = objj_getClass("TNStropheClient")
00390 if(!the_class) throw new SyntaxError("*** Could not find definition for class \"TNStropheClient\"");
00391 var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("initWithCoder:"), function $TNStropheClient__initWithCoder_(self, _cmd, aCoder)
00392 {
00393     self = objj_msgSendSuper({ receiver:self, super_class:objj_getClass("TNStropheClient").super_class }, "initWithCoder:", aCoder);
00394     if (self)
00395     {
00396         self._JID = (aCoder == null ? null : aCoder.isa.objj_msgSend1(aCoder, "decodeObjectForKey:", "_JID"));
00397         self._password = (aCoder == null ? null : aCoder.isa.objj_msgSend1(aCoder, "decodeObjectForKey:", "_password"));
00398         self._delegate = (aCoder == null ? null : aCoder.isa.objj_msgSend1(aCoder, "decodeObjectForKey:", "_delegate"));
00399         self._connection = (aCoder == null ? null : aCoder.isa.objj_msgSend1(aCoder, "decodeObjectForKey:", "_connection"));
00400     }
00401     return self;
00402 }
00403 ,["id","CPCoder"]), new objj_method(sel_getUid("encodeWithCoder:"), function $TNStropheClient__encodeWithCoder_(self, _cmd, aCoder)
00404 {
00405     objj_msgSendSuper({ receiver:self, super_class:objj_getClass("TNStropheClient").super_class }, "encodeWithCoder:", aCoder);
00406     (aCoder == null ? null : aCoder.isa.objj_msgSend2(aCoder, "encodeObject:forKey:", self._JID, "_JID"));
00407     (aCoder == null ? null : aCoder.isa.objj_msgSend2(aCoder, "encodeObject:forKey:", self._password, "_password"));
00408     (aCoder == null ? null : aCoder.isa.objj_msgSend2(aCoder, "encodeObject:forKey:", self._connection, "_connection"));
00409 }
00410 ,["void","CPCoder"])]);
00411 }
 All Classes Namespaces Files Functions Variables