Differences From Artifact [b2b145f65c]:
- File
src/XMPPStanza.m
— part of check-in
[cd21ff1157]
at
2018-11-05 22:30:18
on branch trunk
— Kill #ifdef HAVE_CONFIG_H
There no longer is an Xcode project for which it is needed. (user: js, size: 5808) [annotate] [blame] [check-ins using]
To Artifact [127836dc56]:
- File src/XMPPStanza.m — part of check-in [abf66b5c9b] at 2019-03-16 20:58:13 on branch trunk — Use dot syntax (user: js, size: 5774) [annotate] [blame] [check-ins using]
1 | /* | | | 1 2 3 4 5 6 7 8 9 | /* * Copyright (c) 2011, 2012, 2013, 2019, Jonathan Schleifer <js@heap.zone> * Copyright (c) 2011, Florian Zeitz <florob@babelmonkeys.de> * * https://heap.zone/objxmpp/ * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice is present in all copies. |
︙ | ︙ | |||
125 126 127 128 129 130 131 | stringValue: nil]; @try { if (![name isEqual: @"iq"] && ![name isEqual: @"message"] && ![name isEqual: @"presence"]) @throw [OFInvalidArgumentException exception]; | | | | | | | | | | | 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 | stringValue: nil]; @try { if (![name isEqual: @"iq"] && ![name isEqual: @"message"] && ![name isEqual: @"presence"]) @throw [OFInvalidArgumentException exception]; self.defaultNamespace = XMPP_NS_CLIENT; [self setPrefix: @"stream" forNamespace: XMPP_NS_STREAM]; if (type != nil) self.type = type; if (ID != nil) self.ID = ID; } @catch (id e) { [self release]; @throw e; } return self; } - (instancetype)initWithElement: (OFXMLElement *)element { self = [super initWithElement: element]; @try { OFXMLAttribute *attribute; if ((attribute = [element attributeForName: @"from"])) self.from = [XMPPJID JIDWithString: attribute.stringValue]; if ((attribute = [element attributeForName: @"to"])) self.to = [XMPPJID JIDWithString: attribute.stringValue]; if ((attribute = [element attributeForName: @"type"])) self.type = attribute.stringValue; if ((attribute = [element attributeForName: @"id"])) self.ID = attribute.stringValue; } @catch (id e) { [self release]; @throw e; } return self; } |
︙ | ︙ | |||
190 191 192 193 194 195 196 | _from = [from copy]; [old release]; [self removeAttributeForName: @"from"]; if (from != nil) [self addAttributeWithName: @"from" | | | | 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 | _from = [from copy]; [old release]; [self removeAttributeForName: @"from"]; if (from != nil) [self addAttributeWithName: @"from" stringValue: from.fullJID]; } - (void)setTo: (XMPPJID *)to { XMPPJID *old = _to; _to = [to copy]; [old release]; [self removeAttributeForName: @"to"]; if (to != nil) [self addAttributeWithName: @"to" stringValue: to.fullJID]; } - (void)setType: (OFString *)type { OFString *old = _type; _type = [type copy]; [old release]; |
︙ | ︙ |