66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
|
- (XMPPIQ *)errorIQWithType: (OFString *)type
condition: (OFString *)condition
text: (OFString *)text
{
XMPPIQ *ret = [XMPPIQ IQWithType: @"error"
ID: [self ID]];
OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init];
OFXMLElement *error = [OFXMLElement elementWithName: @"error"
namespace: XMPP_NS_CLIENT];
[error addAttributeWithName: @"type"
stringValue: type];
[error addChild: [OFXMLElement elementWithName: condition
namespace: XMPP_NS_STANZAS]];
if (text)
[error addChild: [OFXMLElement elementWithName: @"text"
namespace: XMPP_NS_STANZAS
stringValue: text]];
[ret addChild: error];
[ret setTo: [self from]];
[ret setFrom: nil];
[pool release];
return ret;
}
- (XMPPIQ *)errorIQWithType: (OFString *)type
condition: (OFString *)condition
{
return [self errorIQWithType: type
condition: condition
text: nil];
}
@end
|
|
|
|
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
|
- (XMPPIQ *)errorIQWithType: (OFString *)type
condition: (OFString *)condition
text: (OFString *)text
{
XMPPIQ *ret = [XMPPIQ IQWithType: @"error"
ID: [self ID]];
void *pool = objc_autoreleasePoolPush();
OFXMLElement *error = [OFXMLElement elementWithName: @"error"
namespace: XMPP_NS_CLIENT];
[error addAttributeWithName: @"type"
stringValue: type];
[error addChild: [OFXMLElement elementWithName: condition
namespace: XMPP_NS_STANZAS]];
if (text)
[error addChild: [OFXMLElement elementWithName: @"text"
namespace: XMPP_NS_STANZAS
stringValue: text]];
[ret addChild: error];
[ret setTo: [self from]];
[ret setFrom: nil];
objc_autoreleasePoolPop(pool);
return ret;
}
- (XMPPIQ *)errorIQWithType: (OFString *)type
condition: (OFString *)condition
{
return [self errorIQWithType: type
condition: condition
text: nil];
}
@end
|