StropheCappuccino API 1.0.0
/tmp/tempDoc.doc/Build/StropheCappuccino.build/Debug/Browser.environment/Sources/TNStropheStanza.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;11;TNXMLNode.jt;12168;objj_executeFile("Foundation/Foundation.j", NO);objj_executeFile("Resources/Strophe/strophe.js", YES);objj_executeFile("TNStropheJID.j", YES);objj_executeFile("TNXMLNode.j", YES);{var the_class = objj_allocateClassPair(TNXMLNode, "TNStropheStanza"),
00002 meta_class = the_class.isa;objj_registerClassPair(the_class);
00003 class_addMethods(the_class, [new objj_method(sel_getUid("initWithName:to:attributes:bare:"), function $TNStropheStanza__initWithName_to_attributes_bare_(self, _cmd, aName, aJID, someAttributes, sendToBareJID)
00004 {
00005     if (aJID && !someAttributes)
00006         someAttributes = {};
00007     if (someAttributes)
00008     {
00009         if (someAttributes.isa)
00010             (someAttributes == null ? null : someAttributes.isa.objj_msgSend2(someAttributes, "setValue:forKey:", sendToBareJID ? (aJID == null ? null : aJID.isa.objj_msgSend0(aJID, "bare")) : aJID, "to"));
00011         else
00012             someAttributes.to = sendToBareJID ? (aJID == null ? null : aJID.isa.objj_msgSend0(aJID, "bare")) : (aJID == null ? null : aJID.isa.objj_msgSend0(aJID, "full"));
00013     }
00014     return objj_msgSendSuper({ receiver:self, super_class:objj_getClass("TNStropheStanza").super_class }, "initWithName:andAttributes:", aName, someAttributes);
00015 }
00016 ,["TNStropheStanza","CPString","TNStropheJID","CPDictionary","BOOL"]), new objj_method(sel_getUid("from"), function $TNStropheStanza__from(self, _cmd)
00017 {
00018     while (self.isa.objj_msgSend0(self, "up"));
00019     return TNStropheJID.isa.objj_msgSend1(TNStropheJID, "stropheJIDWithString:", self.isa.objj_msgSend1(self, "valueForAttribute:", "from"));
00020 }
00021 ,["CPString"]), new objj_method(sel_getUid("setFrom:"), function $TNStropheStanza__setFrom_(self, _cmd, aFrom)
00022 {
00023     if ((aFrom == null ? null : aFrom.isa.objj_msgSend1(aFrom, "isKindOfClass:", CPString)))
00024         aFrom = TNStropheJID.isa.objj_msgSend1(TNStropheJID, "stropheJIDWithString:", aFrom);
00025     while (self.isa.objj_msgSend0(self, "up"));
00026     self.isa.objj_msgSend2(self, "setValue:forAttribute:", (aFrom == null ? null : aFrom.isa.objj_msgSend0(aFrom, "full")), "from");
00027 }
00028 ,["void","id"]), new objj_method(sel_getUid("fromBare"), function $TNStropheStanza__fromBare(self, _cmd)
00029 {
00030     return ((___r1 = self.isa.objj_msgSend0(self, "from")), ___r1 == null ? null : ___r1.isa.objj_msgSend0(___r1, "bare"));
00031     var ___r1;
00032 }
00033 ,["CPString"]), new objj_method(sel_getUid("fromUser"), function $TNStropheStanza__fromUser(self, _cmd)
00034 {
00035     return ((___r1 = self.isa.objj_msgSend0(self, "from")), ___r1 == null ? null : ___r1.isa.objj_msgSend0(___r1, "node"));
00036     var ___r1;
00037 }
00038 ,["CPString"]), new objj_method(sel_getUid("fromDomain"), function $TNStropheStanza__fromDomain(self, _cmd)
00039 {
00040     return ((___r1 = self.isa.objj_msgSend0(self, "from")), ___r1 == null ? null : ___r1.isa.objj_msgSend0(___r1, "domain"));
00041     var ___r1;
00042 }
00043 ,["CPString"]), new objj_method(sel_getUid("fromResource"), function $TNStropheStanza__fromResource(self, _cmd)
00044 {
00045     return ((___r1 = self.isa.objj_msgSend0(self, "from")), ___r1 == null ? null : ___r1.isa.objj_msgSend0(___r1, "resource"));
00046     var ___r1;
00047 }
00048 ,["CPString"]), new objj_method(sel_getUid("to"), function $TNStropheStanza__to(self, _cmd)
00049 {
00050     while (self.isa.objj_msgSend0(self, "up"));
00051     return TNStropheJID.isa.objj_msgSend1(TNStropheJID, "stropheJIDWithString:", self.isa.objj_msgSend1(self, "valueForAttribute:", "to"));
00052 }
00053 ,["CPString"]), new objj_method(sel_getUid("setTo:"), function $TNStropheStanza__setTo_(self, _cmd, aTo)
00054 {
00055     if ((aTo == null ? null : aTo.isa.objj_msgSend1(aTo, "isKindOfClass:", CPString)))
00056         aTo = TNStropheJID.isa.objj_msgSend1(TNStropheJID, "stropheJIDWithString:", aTo);
00057     while (self.isa.objj_msgSend0(self, "up"));
00058     self.isa.objj_msgSend2(self, "setValue:forAttribute:", (aTo == null ? null : aTo.isa.objj_msgSend0(aTo, "full")), "to");
00059 }
00060 ,["void","id"]), new objj_method(sel_getUid("type"), function $TNStropheStanza__type(self, _cmd)
00061 {
00062     return self.isa.objj_msgSend1(self, "valueForAttribute:", "type");
00063 }
00064 ,["CPString"]), new objj_method(sel_getUid("setType:"), function $TNStropheStanza__setType_(self, _cmd, aType)
00065 {
00066     self.isa.objj_msgSend2(self, "setValue:forAttribute:", aType, "type");
00067 }
00068 ,["void","CPString"]), new objj_method(sel_getUid("ID"), function $TNStropheStanza__ID(self, _cmd)
00069 {
00070     return self.isa.objj_msgSend1(self, "valueForAttribute:", "id");
00071 }
00072 ,["CPString"]), new objj_method(sel_getUid("setID:"), function $TNStropheStanza__setID_(self, _cmd, anID)
00073 {
00074     while (self.isa.objj_msgSend0(self, "up"));
00075     self.isa.objj_msgSend2(self, "setValue:forAttribute:", anID, "id");
00076 }
00077 ,["void","CPString"]), new objj_method(sel_getUid("delayTime"), function $TNStropheStanza__delayTime(self, _cmd)
00078 {
00079     if (self.isa.objj_msgSend1(self, "containsChildrenWithName:", "delay") && ((___r1 = self.isa.objj_msgSend1(self, "firstChildWithName:", "delay")), ___r1 == null ? null : ___r1.isa.objj_msgSend0(___r1, "namespace")) == Strophe.NS.DELAY)
00080     {
00081         var messageDelay = ((___r1 = self.isa.objj_msgSend1(self, "firstChildWithName:", "delay")), ___r1 == null ? null : ___r1.isa.objj_msgSend1(___r1, "valueForAttribute:", "stamp")),
00082             match = messageDelay.match(new RegExp(/(\d{4}-\d{2}-\d{2})T(\d{2}:\d{2}:\d{2})Z/));
00083         if (!match || match.length != 3)
00084             CPException.isa.objj_msgSend2(CPException, "raise:reason:", CPInvalidArgumentException, "delayTime: the string must be of YYYY-MM-DDTHH:MM:SSZ format");
00085         return ((___r1 = CPDate.isa.objj_msgSend0(CPDate, "alloc")), ___r1 == null ? null : ___r1.isa.objj_msgSend1(___r1, "initWithString:", match[1] + " " + match[2] + " +0000"));
00086     }
00087     return CPDate.isa.objj_msgSend1(CPDate, "dateWithTimeIntervalSinceNow:", 0);
00088     var ___r1;
00089 }
00090 ,["CPDate"])]);
00091 class_addMethods(meta_class, [new objj_method(sel_getUid("stanzaWithStanza:"), function $TNStropheStanza__stanzaWithStanza_(self, _cmd, aStanza)
00092 {
00093     return ((___r1 = TNStropheStanza.isa.objj_msgSend0(TNStropheStanza, "alloc")), ___r1 == null ? null : ___r1.isa.objj_msgSend1(___r1, "initWithNode:", aStanza));
00094     var ___r1;
00095 }
00096 ,["TNStropheStanza","id"]), new objj_method(sel_getUid("stanzaWithName:andAttributes:"), function $TNStropheStanza__stanzaWithName_andAttributes_(self, _cmd, aName, attributes)
00097 {
00098     return ((___r1 = TNStropheStanza.isa.objj_msgSend0(TNStropheStanza, "alloc")), ___r1 == null ? null : ___r1.isa.objj_msgSend2(___r1, "initWithName:andAttributes:", aName, attributes));
00099     var ___r1;
00100 }
00101 ,["TNStropheStanza","CPString","CPDictionary"]), new objj_method(sel_getUid("stanzaWithName:to:attributes:"), function $TNStropheStanza__stanzaWithName_to_attributes_(self, _cmd, aName, aJID, attributes)
00102 {
00103     return ((___r1 = TNStropheStanza.isa.objj_msgSend0(TNStropheStanza, "alloc")), ___r1 == null ? null : ___r1.isa.objj_msgSend(___r1, "initWithName:to:attributes:bare:", aName, aJID, attributes, NO));
00104     var ___r1;
00105 }
00106 ,["TNStropheStanza","CPString","TNStropheJID","CPDictionary"]), new objj_method(sel_getUid("stanzaWithName:to:attributes:bare:"), function $TNStropheStanza__stanzaWithName_to_attributes_bare_(self, _cmd, aName, aJID, attributes, sendToBareJID)
00107 {
00108     return ((___r1 = TNStropheStanza.isa.objj_msgSend0(TNStropheStanza, "alloc")), ___r1 == null ? null : ___r1.isa.objj_msgSend(___r1, "initWithName:to:attributes:bare:", aName, aJID, attributes, sendToBareJID));
00109     var ___r1;
00110 }
00111 ,["TNStropheStanza","CPString","TNStropheJID","CPDictionary","BOOL"]), new objj_method(sel_getUid("iqWithAttributes:"), function $TNStropheStanza__iqWithAttributes_(self, _cmd, attributes)
00112 {
00113     return TNStropheStanza.isa.objj_msgSend2(TNStropheStanza, "stanzaWithName:andAttributes:", "iq", attributes);
00114 }
00115 ,["TNStropheStanza","CPDictionary"]), new objj_method(sel_getUid("iq"), function $TNStropheStanza__iq(self, _cmd)
00116 {
00117     return TNStropheStanza.isa.objj_msgSend1(TNStropheStanza, "iqWithAttributes:", nil);
00118 }
00119 ,["TNStropheStanza"]), new objj_method(sel_getUid("iqTo:"), function $TNStropheStanza__iqTo_(self, _cmd, aJID)
00120 {
00121     return TNStropheStanza.isa.objj_msgSend2(TNStropheStanza, "iqTo:withAttributes:", aJID, nil);
00122 }
00123 ,["TNStropheStanza","TNStropheJID"]), new objj_method(sel_getUid("iqWithType:"), function $TNStropheStanza__iqWithType_(self, _cmd, aType)
00124 {
00125     return TNStropheStanza.isa.objj_msgSend1(TNStropheStanza, "iqWithAttributes:", {"type": aType});
00126 }
00127 ,["TNStropheStanza","CPString"]), new objj_method(sel_getUid("iqTo:withType:"), function $TNStropheStanza__iqTo_withType_(self, _cmd, aJID, aType)
00128 {
00129     return TNStropheStanza.isa.objj_msgSend2(TNStropheStanza, "iqTo:withAttributes:", aJID, {"type": aType});
00130 }
00131 ,["TNStropheStanza","TNStropheJID","CPString"]), new objj_method(sel_getUid("iqTo:withAttributes:"), function $TNStropheStanza__iqTo_withAttributes_(self, _cmd, aJID, attributes)
00132 {
00133     return TNStropheStanza.isa.objj_msgSend(TNStropheStanza, "stanzaWithName:to:attributes:bare:", "iq", aJID, attributes, NO);
00134 }
00135 ,["TNStropheStanza","TNStropheJID","CPDictionary"]), new objj_method(sel_getUid("iqTo:withAttributes:bare:"), function $TNStropheStanza__iqTo_withAttributes_bare_(self, _cmd, aJID, attributes, sendToBareJID)
00136 {
00137     return TNStropheStanza.isa.objj_msgSend(TNStropheStanza, "stanzaWithName:to:attributes:bare:", "iq", aJID, attributes, sendToBareJID);
00138 }
00139 ,["TNStropheStanza","TNStropheJID","CPDictionary","BOOL"]), new objj_method(sel_getUid("presenceWithAttributes:"), function $TNStropheStanza__presenceWithAttributes_(self, _cmd, attributes)
00140 {
00141     return TNStropheStanza.isa.objj_msgSend2(TNStropheStanza, "stanzaWithName:andAttributes:", "presence", attributes);
00142 }
00143 ,["TNStropheStanza","CPDictionary"]), new objj_method(sel_getUid("presence"), function $TNStropheStanza__presence(self, _cmd)
00144 {
00145     return TNStropheStanza.isa.objj_msgSend1(TNStropheStanza, "presenceWithAttributes:", nil);
00146 }
00147 ,["TNStropheStanza"]), new objj_method(sel_getUid("presenceTo:"), function $TNStropheStanza__presenceTo_(self, _cmd, aJID)
00148 {
00149     return TNStropheStanza.isa.objj_msgSend2(TNStropheStanza, "presenceTo:withAttributes:", aJID, nil);
00150 }
00151 ,["TNStropheStanza","TNStropheJID"]), new objj_method(sel_getUid("presenceTo:withAttributes:"), function $TNStropheStanza__presenceTo_withAttributes_(self, _cmd, aJID, attributes)
00152 {
00153     return TNStropheStanza.isa.objj_msgSend(TNStropheStanza, "stanzaWithName:to:attributes:bare:", "presence", aJID, attributes, NO);
00154 }
00155 ,["TNStropheStanza","TNStropheJID","CPDictionary"]), new objj_method(sel_getUid("presenceTo:withAttributes:bare:"), function $TNStropheStanza__presenceTo_withAttributes_bare_(self, _cmd, aJID, attributes, sendToBareJID)
00156 {
00157     return TNStropheStanza.isa.objj_msgSend(TNStropheStanza, "stanzaWithName:to:attributes:bare:", "presence", aJID, attributes, sendToBareJID);
00158 }
00159 ,["TNStropheStanza","TNStropheJID","CPDictionary","BOOL"]), new objj_method(sel_getUid("messageWithAttributes:"), function $TNStropheStanza__messageWithAttributes_(self, _cmd, attributes)
00160 {
00161     return TNStropheStanza.isa.objj_msgSend2(TNStropheStanza, "stanzaWithName:andAttributes:", "message", attributes);
00162 }
00163 ,["TNStropheStanza","CPDictionary"]), new objj_method(sel_getUid("message"), function $TNStropheStanza__message(self, _cmd)
00164 {
00165     return TNStropheStanza.isa.objj_msgSend1(TNStropheStanza, "messageWithAttributes:", nil);
00166 }
00167 ,["TNStropheStanza"]), new objj_method(sel_getUid("messageTo:"), function $TNStropheStanza__messageTo_(self, _cmd, aJID)
00168 {
00169     return TNStropheStanza.isa.objj_msgSend2(TNStropheStanza, "messageTo:withAttributes:", aJID, nil);
00170 }
00171 ,["TNStropheStanza","TNStropheJID"]), new objj_method(sel_getUid("messageTo:withAttributes:"), function $TNStropheStanza__messageTo_withAttributes_(self, _cmd, aJID, attributes)
00172 {
00173     return TNStropheStanza.isa.objj_msgSend3(TNStropheStanza, "stanzaWithName:to:attributes:", "message", aJID, attributes);
00174 }
00175 ,["TNStropheStanza","TNStropheJID","CPDictionary"]), new objj_method(sel_getUid("messageTo:withAttributes:bare:"), function $TNStropheStanza__messageTo_withAttributes_bare_(self, _cmd, aJID, attributes, sendToBareJID)
00176 {
00177     return TNStropheStanza.isa.objj_msgSend(TNStropheStanza, "stanzaWithName:to:attributes:bare:", "message", aJID, attributes, sendToBareJID);
00178 }
00179 ,["TNStropheStanza","TNStropheJID","CPDictionary","BOOL"])]);
00180 }
 All Classes Namespaces Files Functions Variables