1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
-
-
-
-
+
+
+
+
-
-
+
+
|
#import "XMPPIQ.h"
@implementation XMPPIQ
+ IQWithType: (OFString*)type_
ID: (OFString*)ID_
{
return [[[self alloc] initWithType: type_
ID: ID_] autorelease];
}
- initWithType: (OFString*)type_
ID: (OFString*)ID_
{
if (!([type_ isEqual: @"get"] ||
[type_ isEqual: @"set"] ||
[type_ isEqual: @"result"] ||
[type_ isEqual: @"error"]))
if (![type_ isEqual: @"get"] &&
![type_ isEqual: @"set"] &&
![type_ isEqual: @"result"] &&
![type_ isEqual: @"error"])
of_log(@"Invalid IQ type!");
return [super initWithName: @"iq"
type: type_
ID: ID_];
type: type_
ID: ID_];
}
@end
|