StropheCappuccino API 1.0.0
/tmp/tempDoc.doc/Build/StropheCappuccino.build/Debug/Browser.environment/Sources/TNStropheConnection.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;17;TNStropheStanza.jt;28140;objj_executeFile("Foundation/Foundation.j", NO);objj_executeFile("Resources/Strophe/strophe.js", YES);objj_executeFile("TNStropheJID.j", YES);objj_executeFile("TNStropheStanza.j", YES);TNStropheConnectionStatusAuthenticatingNotification = "TNStropheConnectionStatusAuthenticatingNotification";
00002 TNStropheConnectionStatusAuthFailureNotification = "TNStropheConnectionStatusAuthFailureNotification";
00003 TNStropheConnectionStatusConnectedNotification = "TNStropheConnectionStatusConnectedNotification";
00004 TNStropheConnectionStatusConnectingNotification = "TNStropheConnectionStatusConnectingNotification";
00005 TNStropheConnectionStatusConnectionFailureNotification = "TNStropheConnectionStatusConnectionFailureNotification";
00006 TNStropheConnectionStatusDisconnectedNotification = "TNStropheConnectionStatusDisconnectedNotification";
00007 TNStropheConnectionStatusDisconnectingNotification = "TNStropheConnectionStatusDisconnectingNotification";
00008 TNStropheConnectionStatusErrorNotification = "TNStropheConnectionStatusErrorNotification";
00009 TNStropheConnectionStatusWillDisconnectNotification = "TNStropheConnectionStatusWillDisconnectNotification";
00010 var TNStropheTimerRunLoopMode = "TNStropheTimerRunLoopMode";
00011 {var the_class = objj_allocateClassPair(CPObject, "TNStropheConnection"),
00012 meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_connected"), new objj_ivar("_password"), new objj_ivar("_giveupTimeout"), new objj_ivar("_currentStatus"), new objj_ivar("_delegate"), new objj_ivar("_connectionTimeout"), new objj_ivar("_maxConnections"), new objj_ivar("_registeredHandlers"), new objj_ivar("_registeredTimedHandlers"), new objj_ivar("_timersIds"), new objj_ivar("_boshService"), new objj_ivar("_userPresenceShow"), new objj_ivar("_userPresenceStatus"), new objj_ivar("_giveUpTimer"), new objj_ivar("_stropheJSRunloopInterval"), new objj_ivar("_connection"), new objj_ivar("_JID")]);objj_registerClassPair(the_class);
00013 class_addMethods(the_class, [new objj_method(sel_getUid("isConnected"), function $TNStropheConnection__isConnected(self, _cmd)
00014 {
00015     return self._connected;
00016 }
00017 ,["BOOL"]), new objj_method(sel_getUid("_setConnected:"), function $TNStropheConnection___setConnected_(self, _cmd, newValue)
00018 {
00019     self._connected = newValue;
00020 }
00021 ,["void","BOOL"]), new objj_method(sel_getUid("password"), function $TNStropheConnection__password(self, _cmd)
00022 {
00023     return self._password;
00024 }
00025 ,["CPString"]), new objj_method(sel_getUid("setPassword:"), function $TNStropheConnection__setPassword_(self, _cmd, newValue)
00026 {
00027     self._password = newValue;
00028 }
00029 ,["void","CPString"]), new objj_method(sel_getUid("giveupTimeout"), function $TNStropheConnection__giveupTimeout(self, _cmd)
00030 {
00031     return self._giveupTimeout;
00032 }
00033 ,["float"]), new objj_method(sel_getUid("setGiveupTimeout:"), function $TNStropheConnection__setGiveupTimeout_(self, _cmd, newValue)
00034 {
00035     self._giveupTimeout = newValue;
00036 }
00037 ,["void","float"]), new objj_method(sel_getUid("currentStatus"), function $TNStropheConnection__currentStatus(self, _cmd)
00038 {
00039     return self._currentStatus;
00040 }
00041 ,["id"]), new objj_method(sel_getUid("_setCurrentStatus:"), function $TNStropheConnection___setCurrentStatus_(self, _cmd, newValue)
00042 {
00043     self._currentStatus = newValue;
00044 }
00045 ,["void","id"]), new objj_method(sel_getUid("delegate"), function $TNStropheConnection__delegate(self, _cmd)
00046 {
00047     return self._delegate;
00048 }
00049 ,["id"]), new objj_method(sel_getUid("_setDelegate:"), function $TNStropheConnection___setDelegate_(self, _cmd, newValue)
00050 {
00051     self._delegate = newValue;
00052 }
00053 ,["void","id"]), new objj_method(sel_getUid("connectionTimeout"), function $TNStropheConnection__connectionTimeout(self, _cmd)
00054 {
00055     return self._connectionTimeout;
00056 }
00057 ,["int"]), new objj_method(sel_getUid("setConnectionTimeout:"), function $TNStropheConnection__setConnectionTimeout_(self, _cmd, newValue)
00058 {
00059     self._connectionTimeout = newValue;
00060 }
00061 ,["void","int"]), new objj_method(sel_getUid("maxConnections"), function $TNStropheConnection__maxConnections(self, _cmd)
00062 {
00063     return self._maxConnections;
00064 }
00065 ,["int"]), new objj_method(sel_getUid("setMaxConnections:"), function $TNStropheConnection__setMaxConnections_(self, _cmd, newValue)
00066 {
00067     self._maxConnections = newValue;
00068 }
00069 ,["void","int"]), new objj_method(sel_getUid("initWithService:andDelegate:"), function $TNStropheConnection__initWithService_andDelegate_(self, _cmd, aService, aDelegate)
00070 {
00071     if (self = objj_msgSendSuper({ receiver:self, super_class:objj_getClass("TNStropheConnection").super_class }, "init"))
00072     {
00073         var bundle = CPBundle.isa.objj_msgSend1(CPBundle, "bundleForClass:", (self == null ? null : self.isa.objj_msgSend0(self, "class")));
00074         self._registeredHandlers = CPArray.isa.objj_msgSend0(CPArray, "array");
00075         self._registeredTimedHandlers = CPArray.isa.objj_msgSend0(CPArray, "array");
00076         self._connected = NO;
00077         self._maxConnections = (bundle == null ? null : bundle.isa.objj_msgSend1(bundle, "objectForInfoDictionaryKey:", "TNStropheConnectionMaxConnection"));
00078         self._connectionTimeout = (bundle == null ? null : bundle.isa.objj_msgSend1(bundle, "objectForInfoDictionaryKey:", "TNStropheConnectionTimeout"));
00079         self._giveupTimeout = (bundle == null ? null : bundle.isa.objj_msgSend1(bundle, "objectForInfoDictionaryKey:", "TNStropheConnectionGiveUpTimer"));
00080         self._currentStatus = Strophe.Status.DISCONNECTED;
00081         self._boshService = aService;
00082         self._connection = new Strophe.Connection(self._boshService);
00083         self._delegate = aDelegate;
00084         self._timersIds = CPDictionary.isa.objj_msgSend0(CPDictionary, "dictionary");
00085         self._stropheJSRunloopInterval = (bundle == null ? null : bundle.isa.objj_msgSend1(bundle, "objectForInfoDictionaryKey:", "TNStropheJSRunLoopInterval"));
00086         if ((bundle == null ? null : bundle.isa.objj_msgSend1(bundle, "objectForInfoDictionaryKey:", "TNStropheJSUseCappuccinoRunLoop")) == 1)
00087         {
00088             CPLog.info("StropheCappuccino has been compiled to use the Cappuccino runloop. unsing interval of " + self._stropheJSRunloopInterval);
00089             Strophe.setTimeout = function(f, delay)
00090             {
00091                 ((___r1 = CPRunLoop.isa.objj_msgSend0(CPRunLoop, "currentRunLoop")), ___r1 == null ? null : ___r1.isa.objj_msgSend1(___r1, "limitDateForMode:", CPDefaultRunLoopMode));
00092                 var timerID = (self == null ? null : self.isa.objj_msgSend0(self, "getUniqueId")),
00093                     timer = CPTimer.isa.objj_msgSend(CPTimer, "timerWithTimeInterval:target:selector:userInfo:repeats:", self._stropheJSRunloopInterval, self, sel_getUid("triggerStropheTimer:"), {"function": f, "id": timerID}, NO);
00094                 ((___r1 = CPRunLoop.isa.objj_msgSend0(CPRunLoop, "currentRunLoop")), ___r1 == null ? null : ___r1.isa.objj_msgSend2(___r1, "addTimer:forMode:", timer, CPDefaultRunLoopMode));
00095                 ((___r1 = self._timersIds), ___r1 == null ? null : ___r1.isa.objj_msgSend2(___r1, "setObject:forKey:", timer, timerID));
00096                 return timerID;
00097                 var ___r1;
00098             };
00099             Strophe.clearTimeout = function(tid)
00100             {
00101                 ((___r1 = CPRunLoop.isa.objj_msgSend0(CPRunLoop, "currentRunLoop")), ___r1 == null ? null : ___r1.isa.objj_msgSend1(___r1, "limitDateForMode:", CPDefaultRunLoopMode));
00102                 var timer = ((___r1 = self._timersIds), ___r1 == null ? null : ___r1.isa.objj_msgSend1(___r1, "objectForKey:", tid));
00103                 (timer == null ? null : timer.isa.objj_msgSend0(timer, "invalidate"));
00104                 ((___r1 = self._timersIds), ___r1 == null ? null : ___r1.isa.objj_msgSend1(___r1, "removeObjectForKey:", tid));
00105                 var ___r1;
00106             };
00107         }
00108     }
00109     return self;
00110 }
00111 ,["id","CPString","id"]), new objj_method(sel_getUid("triggerStropheTimer:"), function $TNStropheConnection__triggerStropheTimer_(self, _cmd, aTimer)
00112 {
00113     ((___r1 = self._timersIds), ___r1 == null ? null : ___r1.isa.objj_msgSend1(___r1, "removeObjectForKey:", (aTimer == null ? null : aTimer.isa.objj_msgSend0(aTimer, "userInfo"))["id"]));
00114     (aTimer == null ? null : aTimer.isa.objj_msgSend0(aTimer, "userInfo"))["function"]();
00115     (aTimer == null ? null : aTimer.isa.objj_msgSend0(aTimer, "invalidate"));
00116     var ___r1;
00117 }
00118 ,["void","CPTimer"]), new objj_method(sel_getUid("JID"), function $TNStropheConnection__JID(self, _cmd)
00119 {
00120     if (((___r1 = self._delegate), ___r1 == null ? null : ___r1.isa.objj_msgSend1(___r1, "respondsToSelector:", sel_getUid("JID"))))
00121         return ((___r1 = self._delegate), ___r1 == null ? null : ___r1.isa.objj_msgSend0(___r1, "JID"));
00122     else
00123         return self._JID;
00124     var ___r1;
00125 }
00126 ,["TNStropheJID"]), new objj_method(sel_getUid("connectWithJID:andPassword:"), function $TNStropheConnection__connectWithJID_andPassword_(self, _cmd, aJID, aPassword)
00127 {
00128     if (self._currentStatus !== Strophe.Status.DISCONNECTED)
00129         return;
00130     self._JID = aJID;
00131     self._connection.connect((aJID == null ? null : aJID.isa.objj_msgSend0(aJID, "full")), aPassword, function(status, errorCond)
00132     {
00133         ((___r1 = CPRunLoop.isa.objj_msgSend0(CPRunLoop, "currentRunLoop")), ___r1 == null ? null : ___r1.isa.objj_msgSend1(___r1, "limitDateForMode:", CPDefaultRunLoopMode));
00134         var selector,
00135             notificationName;
00136         self._currentStatus = status;
00137         if (errorCond)
00138         {
00139             self._currentStatus = Strophe.Status.DISCONNECTED;
00140             if (((___r1 = self._delegate), ___r1 == null ? null : ___r1.isa.objj_msgSend1(___r1, "respondsToSelector:", sel_getUid("connection:errorCondition:"))))
00141                 ((___r1 = self._delegate), ___r1 == null ? null : ___r1.isa.objj_msgSend2(___r1, "connection:errorCondition:", self, errorCond));
00142         }
00143         else
00144         {
00145             switch(status) {
00146             case Strophe.Status.ERROR:
00147                 selector = sel_getUid("onStropheError:");
00148                 notificationName = TNStropheConnectionStatusErrorNotification;
00149                 break;
00150             case Strophe.Status.CONNECTING:
00151                 selector = sel_getUid("onStropheConnecting:");
00152                 notificationName = TNStropheConnectionStatusConnectingNotification;
00153                 self._giveUpTimer = CPTimer.isa.objj_msgSend3(CPTimer, "scheduledTimerWithTimeInterval:callback:repeats:", self._giveupTimeout, function(aTimer)
00154                 {
00155                     self._currentStatus = Strophe.Status.DISCONNECTED;
00156                     self._giveUpTimer = nil;
00157                     self.isa.objj_msgSend0(self, "reset");
00158                     if (self._currentStatus === Strophe.Status.CONNECTING && ((___r1 = self._delegate), ___r1 == null ? null : ___r1.isa.objj_msgSend1(___r1, "respondsToSelector:", sel_getUid("connection:errorCondition:"))))
00159                         ((___r1 = self._delegate), ___r1 == null ? null : ___r1.isa.objj_msgSend2(___r1, "connection:errorCondition:", self, "Cannot connect"));
00160                     var ___r1;
00161                 }, NO);
00162                 break;
00163             case Strophe.Status.CONNFAIL:
00164                 selector = sel_getUid("onStropheConnectFail:");
00165                 notificationName = TNStropheConnectionStatusConnectionFailureNotification;
00166                 self._connected = NO;
00167                 break;
00168             case Strophe.Status.AUTHENTICATING:
00169                 selector = sel_getUid("onStropheAuthenticating:");
00170                 notificationName = TNStropheConnectionStatusAuthenticatingNotification;
00171                 self._connected = NO;
00172                 break;
00173             case Strophe.Status.AUTHFAIL:
00174                 selector = sel_getUid("onStropheAuthFail:");
00175                 notificationName = TNStropheConnectionStatusAuthFailureNotification;
00176                 self._connected = NO;
00177                 break;
00178             case Strophe.Status.DISCONNECTING:
00179                 selector = sel_getUid("onStropheDisconnecting:");
00180                 notificationName = TNStropheConnectionStatusDisconnectingNotification;
00181                 self._connected = YES;
00182                 break;
00183             case Strophe.Status.DISCONNECTED:
00184                 self.isa.objj_msgSend0(self, "deleteAllRegisteredSelectors");
00185                 selector = sel_getUid("onStropheDisconnected:");
00186                 notificationName = TNStropheConnectionStatusDisconnectedNotification;
00187                 self._connected = NO;
00188                 break;
00189             case Strophe.Status.CONNECTED:
00190                 selector = sel_getUid("onStropheConnected:");
00191                 notificationName = TNStropheConnectionStatusConnectedNotification;
00192                 self._connected = YES;
00193                 if (self._giveUpTimer)
00194                     ((___r1 = self._giveUpTimer), ___r1 == null ? null : ___r1.isa.objj_msgSend0(___r1, "invalidate"));
00195                 break;
00196             }
00197         }
00198         if (selector && ((___r1 = self._delegate), ___r1 == null ? null : ___r1.isa.objj_msgSend1(___r1, "respondsToSelector:", selector)))
00199             ((___r1 = self._delegate), ___r1 == null ? null : ___r1.isa.objj_msgSend2(___r1, "performSelector:withObject:", selector, self));
00200         if (notificationName)
00201             ((___r1 = CPNotificationCenter.isa.objj_msgSend0(CPNotificationCenter, "defaultCenter")), ___r1 == null ? null : ___r1.isa.objj_msgSend2(___r1, "postNotificationName:object:", notificationName, self));
00202         var ___r1;
00203     }, self._connectionTimeout, self._maxConnections);
00204 }
00205 ,["void","TNStropheJID","CPString"]), new objj_method(sel_getUid("disconnect"), function $TNStropheConnection__disconnect(self, _cmd)
00206 {
00207     if (self._currentStatus === Strophe.Status.DISCONNECTED)
00208         return;
00209     ((___r1 = CPNotificationCenter.isa.objj_msgSend0(CPNotificationCenter, "defaultCenter")), ___r1 == null ? null : ___r1.isa.objj_msgSend2(___r1, "postNotificationName:object:", TNStropheConnectionStatusWillDisconnectNotification, self));
00210     self._connection.disconnect();
00211     var ___r1;
00212 }
00213 ,["void"]), new objj_method(sel_getUid("reset"), function $TNStropheConnection__reset(self, _cmd)
00214 {
00215     if (self._connection)
00216         self._connection.reset();
00217 }
00218 ,["void"]), new objj_method(sel_getUid("pause"), function $TNStropheConnection__pause(self, _cmd)
00219 {
00220     if (self._connection)
00221         self._connection.pause();
00222 }
00223 ,["void"]), new objj_method(sel_getUid("resume"), function $TNStropheConnection__resume(self, _cmd)
00224 {
00225     if (self._connection)
00226         self._connection.pause();
00227 }
00228 ,["void"]), new objj_method(sel_getUid("flush"), function $TNStropheConnection__flush(self, _cmd)
00229 {
00230     self._connection.flush();
00231 }
00232 ,["void"]), new objj_method(sel_getUid("JID"), function $TNStropheConnection__JID(self, _cmd)
00233 {
00234     return ((___r1 = self._delegate), ___r1 == null ? null : ___r1.isa.objj_msgSend0(___r1, "JID"));
00235     var ___r1;
00236 }
00237 ,["TNStropheJID"]), new objj_method(sel_getUid("send:"), function $TNStropheConnection__send_(self, _cmd, aStanza)
00238 {
00239     if (self._currentStatus == Strophe.Status.CONNECTED)
00240     {
00241         CPLog.trace("StropheCappuccino Stanza Send:");
00242         CPLog.trace(aStanza);
00243         ((___r1 = CPRunLoop.isa.objj_msgSend0(CPRunLoop, "currentRunLoop")), ___r1 == null ? null : ___r1.isa.objj_msgSend(___r1, "performSelector:target:argument:order:modes:", sel_getUid("performSend:"), self, aStanza, 0, [CPDefaultRunLoopMode]));
00244     }
00245     var ___r1;
00246 }
00247 ,["void","TNStropheStanza"]), new objj_method(sel_getUid("performSend:"), function $TNStropheConnection__performSend_(self, _cmd, aStanza)
00248 {
00249     self._connection.send((aStanza == null ? null : aStanza.isa.objj_msgSend0(aStanza, "tree")));
00250 }
00251 ,["void","TNStropheStanza"]), new objj_method(sel_getUid("getUniqueId"), function $TNStropheConnection__getUniqueId(self, _cmd)
00252 {
00253     return self.isa.objj_msgSend1(self, "getUniqueIdWithSuffix:", null);
00254 }
00255 ,["CPString"]), new objj_method(sel_getUid("getUniqueIdWithSuffix:"), function $TNStropheConnection__getUniqueIdWithSuffix_(self, _cmd, suffix)
00256 {
00257     return self._connection.getUniqueId(suffix);
00258 }
00259 ,["CPString","CPString"]), new objj_method(sel_getUid("registerSelector:ofObject:withDict:userInfo:handlerDelegate:"), function $TNStropheConnection__registerSelector_ofObject_withDict_userInfo_handlerDelegate_(self, _cmd, aSelector, anObject, aDict, someUserInfo, aHandlerDelegate)
00260 {
00261     var from = ((___r1 = (aDict == null ? null : aDict.isa.objj_msgSend1(aDict, "valueForKey:", "from"))), ___r1 == null ? null : ___r1.isa.objj_msgSend1(___r1, "isKindOfClass:", CPString)) ? (aDict == null ? null : aDict.isa.objj_msgSend1(aDict, "valueForKey:", "from")) : ((___r1 = (aDict == null ? null : aDict.isa.objj_msgSend1(aDict, "valueForKey:", "from"))), ___r1 == null ? null : ___r1.isa.objj_msgSend0(___r1, "stringValue")),
00262         handlerId = self._connection.addHandler(function(stanza)
00263     {
00264         ((___r1 = CPRunLoop.isa.objj_msgSend0(CPRunLoop, "currentRunLoop")), ___r1 == null ? null : ___r1.isa.objj_msgSend1(___r1, "limitDateForMode:", CPDefaultRunLoopMode));
00265         var stanzaObject = TNStropheStanza.isa.objj_msgSend1(TNStropheStanza, "stanzaWithStanza:", stanza),
00266             ret;
00267         if (someUserInfo)
00268             ret = (anObject == null ? null : anObject.isa.objj_msgSend3(anObject, "performSelector:withObject:withObject:", aSelector, stanzaObject, someUserInfo));
00269         else
00270             ret = (anObject == null ? null : anObject.isa.objj_msgSend2(anObject, "performSelector:withObject:", aSelector, stanzaObject));
00271         CPLog.trace("StropheCappuccino stanza received that trigger selector : " + (anObject == null ? null : anObject.isa.objj_msgSend0(anObject, "class")) + "." + aSelector);
00272         CPLog.trace(stanzaObject);
00273         delete aDict.options;
00274         delete someUserInfo;
00275         if (aHandlerDelegate && (aHandlerDelegate == null ? null : aHandlerDelegate.isa.objj_msgSend1(aHandlerDelegate, "respondsToSelector:", sel_getUid("stropheConnection:performedHandlerId:"))))
00276             (aHandlerDelegate == null ? null : aHandlerDelegate.isa.objj_msgSend2(aHandlerDelegate, "stropheConnection:performedHandlerId:", self, handlerId));
00277         someUserInfo = nil;
00278         ((___r1 = self._registeredHandlers), ___r1 == null ? null : ___r1.isa.objj_msgSend1(___r1, "removeObject:", handlerId));
00279         return ret;
00280         var ___r1;
00281     }, (aDict == null ? null : aDict.isa.objj_msgSend1(aDict, "valueForKey:", "namespace")), (aDict == null ? null : aDict.isa.objj_msgSend1(aDict, "valueForKey:", "name")), (aDict == null ? null : aDict.isa.objj_msgSend1(aDict, "valueForKey:", "type")), (aDict == null ? null : aDict.isa.objj_msgSend1(aDict, "valueForKey:", "id")), from, (aDict == null ? null : aDict.isa.objj_msgSend1(aDict, "valueForKey:", "options")));
00282     ((___r1 = self._registeredHandlers), ___r1 == null ? null : ___r1.isa.objj_msgSend1(___r1, "addObject:", handlerId));
00283     return handlerId;
00284     var ___r1;
00285 }
00286 ,["id","SEL","CPObject","id","id","id"]), new objj_method(sel_getUid("registerSelector:ofObject:withDict:handlerDelegate:"), function $TNStropheConnection__registerSelector_ofObject_withDict_handlerDelegate_(self, _cmd, aSelector, anObject, aDict, aHandlerDelegate)
00287 {
00288     return self.isa.objj_msgSend(self, "registerSelector:ofObject:withDict:userInfo:handlerDelegate:", aSelector, anObject, aDict, nil, aHandlerDelegate);
00289 }
00290 ,["id","SEL","CPObject","id","id"]), new objj_method(sel_getUid("registerSelector:ofObject:withDict:userInfo:"), function $TNStropheConnection__registerSelector_ofObject_withDict_userInfo_(self, _cmd, aSelector, anObject, aDict, someUserInfo)
00291 {
00292     return self.isa.objj_msgSend(self, "registerSelector:ofObject:withDict:userInfo:handlerDelegate:", aSelector, anObject, aDict, someUserInfo, nil);
00293 }
00294 ,["id","SEL","CPObject","id","id"]), new objj_method(sel_getUid("registerSelector:ofObject:withDict:"), function $TNStropheConnection__registerSelector_ofObject_withDict_(self, _cmd, aSelector, anObject, aDict)
00295 {
00296     return self.isa.objj_msgSend(self, "registerSelector:ofObject:withDict:userInfo:handlerDelegate:", aSelector, anObject, aDict, nil, nil);
00297 }
00298 ,["id","SEL","CPObject","id"]), new objj_method(sel_getUid("registerTimeoutSelector:ofObject:withDict:forTimeout:"), function $TNStropheConnection__registerTimeoutSelector_ofObject_withDict_forTimeout_(self, _cmd, aTimeoutSelector, anObject, aDict, aTimeout)
00299 {
00300     var from = ((___r1 = (aDict == null ? null : aDict.isa.objj_msgSend1(aDict, "valueForKey:", "from"))), ___r1 == null ? null : ___r1.isa.objj_msgSend1(___r1, "isKindOfClass:", CPString)) ? (aDict == null ? null : aDict.isa.objj_msgSend1(aDict, "valueForKey:", "from")) : ((___r1 = (aDict == null ? null : aDict.isa.objj_msgSend1(aDict, "valueForKey:", "from"))), ___r1 == null ? null : ___r1.isa.objj_msgSend0(___r1, "stringValue")),
00301         handlerId = self._connection.addTimedHandler(aTimeout, function(stanza)
00302     {
00303         if (!stanza)
00304         {
00305             ((___r1 = CPRunLoop.isa.objj_msgSend0(CPRunLoop, "currentRunLoop")), ___r1 == null ? null : ___r1.isa.objj_msgSend1(___r1, "limitDateForMode:", CPDefaultRunLoopMode));
00306             var ret = (anObject == null ? null : anObject.isa.objj_msgSend1(anObject, "performSelector:", aTimeoutSelector));
00307             CPLog.trace("StropheCappuccino stanza timeout that trigger selector : " + (anObject == null ? null : anObject.isa.objj_msgSend0(anObject, "class")) + "." + aTimeoutSelector);
00308             delete aDict.options;
00309             return ret;
00310         }
00311         ((___r1 = self._registeredTimedHandlers), ___r1 == null ? null : ___r1.isa.objj_msgSend1(___r1, "removeObject:", handlerId));
00312         return NO;
00313         var ___r1;
00314     }, (aDict == null ? null : aDict.isa.objj_msgSend1(aDict, "valueForKey:", "namespace")), (aDict == null ? null : aDict.isa.objj_msgSend1(aDict, "valueForKey:", "name")), (aDict == null ? null : aDict.isa.objj_msgSend1(aDict, "valueForKey:", "type")), (aDict == null ? null : aDict.isa.objj_msgSend1(aDict, "valueForKey:", "id")), from, (aDict == null ? null : aDict.isa.objj_msgSend1(aDict, "valueForKey:", "options")));
00315     ((___r1 = self._registeredTimedHandlers), ___r1 == null ? null : ___r1.isa.objj_msgSend1(___r1, "addObject:", handlerId));
00316     return handlerId;
00317     var ___r1;
00318 }
00319 ,["id","SEL","CPObject","id","float"]), new objj_method(sel_getUid("deleteRegisteredSelector:"), function $TNStropheConnection__deleteRegisteredSelector_(self, _cmd, aHandlerId)
00320 {
00321     self._connection.deleteHandler(aHandlerId);
00322     ((___r1 = self._registeredHandlers), ___r1 == null ? null : ___r1.isa.objj_msgSend1(___r1, "removeObject:", aHandlerId));
00323     var ___r1;
00324 }
00325 ,["void","id"]), new objj_method(sel_getUid("deleteRegisteredTimedSelector:"), function $TNStropheConnection__deleteRegisteredTimedSelector_(self, _cmd, aTimedHandlerId)
00326 {
00327     self._connection.deleteTimedHandler(aTimedHandlerId);
00328     ((___r1 = self._registeredTimedHandlers), ___r1 == null ? null : ___r1.isa.objj_msgSend1(___r1, "removeObject:", aTimedHandlerId));
00329     var ___r1;
00330 }
00331 ,["void","id"]), new objj_method(sel_getUid("deleteAllRegisteredSelectors"), function $TNStropheConnection__deleteAllRegisteredSelectors(self, _cmd)
00332 {
00333     for (var i = 0; i < ((___r1 = self._registeredHandlers), ___r1 == null ? null : ___r1.isa.objj_msgSend0(___r1, "count")); i++)
00334         self.isa.objj_msgSend1(self, "deleteRegisteredSelector:", ((___r1 = self._registeredHandlers), ___r1 == null ? null : ___r1.isa.objj_msgSend1(___r1, "objectAtIndex:", i)));
00335     for (var i = 0; i < ((___r1 = self._registeredTimedHandlers), ___r1 == null ? null : ___r1.isa.objj_msgSend0(___r1, "count")); i++)
00336         self.isa.objj_msgSend1(self, "deleteRegisteredTimedSelector:", ((___r1 = self._registeredTimedHandlers), ___r1 == null ? null : ___r1.isa.objj_msgSend1(___r1, "objectAtIndex:", i)));
00337     ((___r1 = self._registeredHandlers), ___r1 == null ? null : ___r1.isa.objj_msgSend0(___r1, "removeAllObjects"));
00338     ((___r1 = self._registeredTimedHandlers), ___r1 == null ? null : ___r1.isa.objj_msgSend0(___r1, "removeAllObjects"));
00339     var ___r1;
00340 }
00341 ,["void"]), new objj_method(sel_getUid("rawInputRegisterSelector:ofObject:"), function $TNStropheConnection__rawInputRegisterSelector_ofObject_(self, _cmd, aSelector, anObject)
00342 {
00343     self._connection.xmlInput = function(elem)
00344     {
00345         ((___r1 = CPRunLoop.isa.objj_msgSend0(CPRunLoop, "currentRunLoop")), ___r1 == null ? null : ___r1.isa.objj_msgSend1(___r1, "limitDateForMode:", CPDefaultRunLoopMode));
00346         (anObject == null ? null : anObject.isa.objj_msgSend2(anObject, "performSelector:withObject:", aSelector, TNStropheStanza.isa.objj_msgSend1(TNStropheStanza, "nodeWithXMLNode:", elem)));
00347         var ___r1;
00348     };
00349 }
00350 ,["void","SEL","id"]), new objj_method(sel_getUid("removeRawInputSelector"), function $TNStropheConnection__removeRawInputSelector(self, _cmd)
00351 {
00352     self._connection.xmlInput = function(elem)
00353     {
00354         return;
00355     };
00356 }
00357 ,["void"]), new objj_method(sel_getUid("rawOutputRegisterSelector:ofObject:"), function $TNStropheConnection__rawOutputRegisterSelector_ofObject_(self, _cmd, aSelector, anObject)
00358 {
00359     self._connection.xmlOutput = function(elem)
00360     {
00361         ((___r1 = CPRunLoop.isa.objj_msgSend0(CPRunLoop, "currentRunLoop")), ___r1 == null ? null : ___r1.isa.objj_msgSend1(___r1, "limitDateForMode:", CPDefaultRunLoopMode));
00362         (anObject == null ? null : anObject.isa.objj_msgSend2(anObject, "performSelector:withObject:", aSelector, TNStropheStanza.isa.objj_msgSend1(TNStropheStanza, "nodeWithXMLNode:", elem)));
00363         var ___r1;
00364     };
00365 }
00366 ,["void","SEL","id"]), new objj_method(sel_getUid("removeRawOutputSelector"), function $TNStropheConnection__removeRawOutputSelector(self, _cmd)
00367 {
00368     self._connection.xmlOutput = function(elem)
00369     {
00370         return;
00371     };
00372 }
00373 ,["void"])]);
00374 class_addMethods(meta_class, [new objj_method(sel_getUid("addNamespaceWithName:value:"), function $TNStropheConnection__addNamespaceWithName_value_(self, _cmd, aName, aValue)
00375 {
00376     Strophe.addNamespace(aName, aValue);
00377 }
00378 ,["void","CPString","CPString"]), new objj_method(sel_getUid("connectionWithService:andDelegate:"), function $TNStropheConnection__connectionWithService_andDelegate_(self, _cmd, aService, aDelegate)
00379 {
00380     return ((___r1 = TNStropheConnection.isa.objj_msgSend0(TNStropheConnection, "alloc")), ___r1 == null ? null : ___r1.isa.objj_msgSend2(___r1, "initWithService:andDelegate:", aService, aDelegate));
00381     var ___r1;
00382 }
00383 ,["TNStropheConnection","CPString","id"])]);
00384 }{
00385 var the_class = objj_getClass("TNStropheConnection")
00386 if(!the_class) throw new SyntaxError("*** Could not find definition for class \"TNStropheConnection\"");
00387 var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("initWithCoder:"), function $TNStropheConnection__initWithCoder_(self, _cmd, aCoder)
00388 {
00389     self = objj_msgSendSuper({ receiver:self, super_class:objj_getClass("TNStropheConnection").super_class }, "initWithCoder:", aCoder);
00390     if (self)
00391     {
00392         self._delegate = (aCoder == null ? null : aCoder.isa.objj_msgSend1(aCoder, "decodeObjectForKey:", "_delegate"));
00393         self._boshService = (aCoder == null ? null : aCoder.isa.objj_msgSend1(aCoder, "decodeObjectForKey:", "_boshService"));
00394         self._connection = (aCoder == null ? null : aCoder.isa.objj_msgSend1(aCoder, "decodeObjectForKey:", "_connection"));
00395         self._registeredHandlers = (aCoder == null ? null : aCoder.isa.objj_msgSend1(aCoder, "decodeObjectForKey:", "_registeredHandlers"));
00396         self._registeredTimedHandlers = (aCoder == null ? null : aCoder.isa.objj_msgSend1(aCoder, "decodeObjectForKey:", "_registeredTimedHandlers"));
00397     }
00398     return self;
00399 }
00400 ,["id","CPCoder"]), new objj_method(sel_getUid("encodeWithCoder:"), function $TNStropheConnection__encodeWithCoder_(self, _cmd, aCoder)
00401 {
00402     (aCoder == null ? null : aCoder.isa.objj_msgSend2(aCoder, "encodeObject:forKey:", self._boshService, "_boshService"));
00403     (aCoder == null ? null : aCoder.isa.objj_msgSend2(aCoder, "encodeObject:forKey:", self._connection, "_connection"));
00404     (aCoder == null ? null : aCoder.isa.objj_msgSend2(aCoder, "encodeObject:forKey:", self._registeredHandlers, "_registeredHandlers"));
00405     (aCoder == null ? null : aCoder.isa.objj_msgSend2(aCoder, "encodeObject:forKey:", self._registeredTimedHandlers, "_registeredTimedHandlers"));
00406 }
00407 ,["void","CPCoder"])]);
00408 }
 All Classes Namespaces Files Functions Variables