29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
#import "XMPPJID.h"
#import "XMPPStanza.h"
#import "XMPPIQ.h"
#import "XMPPMessage.h"
#import "XMPPPresence.h"
@interface AppDelegate: OFObject <OFApplicationDelegate, XMPPConnectionDelegate>
{
XMPPConnection *conn;
}
@end
OF_APPLICATION_DELEGATE(AppDelegate)
@implementation AppDelegate
- (void)applicationDidFinishLaunching
{
OFArray *arguments = [OFApplication arguments];
XMPPPresence *pres = [XMPPPresence presence];
[pres addShow: @"chat"];
[pres addStatus: @"Bored"];
[pres addPriority: 20];
pres.to = [XMPPJID JIDWithString: @"alice@example.com"];
|
<
<
<
>
|
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
#import "XMPPJID.h"
#import "XMPPStanza.h"
#import "XMPPIQ.h"
#import "XMPPMessage.h"
#import "XMPPPresence.h"
@interface AppDelegate: OFObject <OFApplicationDelegate, XMPPConnectionDelegate>
@end
OF_APPLICATION_DELEGATE(AppDelegate)
@implementation AppDelegate
- (void)applicationDidFinishLaunching
{
XMPPConnection *conn;
OFArray *arguments = [OFApplication arguments];
XMPPPresence *pres = [XMPPPresence presence];
[pres addShow: @"chat"];
[pres addStatus: @"Bored"];
[pres addPriority: 20];
pres.to = [XMPPJID JIDWithString: @"alice@example.com"];
|
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
|
{
of_log(@"Auth successful");
}
- (void)connection: (XMPPConnection*)conn
wasBoundToJID: (XMPPJID*)jid
{
of_log(@"Bound to JID: %@", [jid fullJID]);
}
- (void)connection: (XMPPConnection*)conn
didReceiveIQ: (XMPPIQ*)iq
{
of_log(@"IQ: %@", iq);
}
|
>
>
>
>
>
>
>
>
|
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
|
{
of_log(@"Auth successful");
}
- (void)connection: (XMPPConnection*)conn
wasBoundToJID: (XMPPJID*)jid
{
XMPPPresence *pres;
of_log(@"Bound to JID: %@", [jid fullJID]);
pres = [XMPPPresence presence];
[pres addPriority: 10];
[pres addStatus: @"ObjXMPP test is working!"];
[conn sendStanza: pres];
}
- (void)connection: (XMPPConnection*)conn
didReceiveIQ: (XMPPIQ*)iq
{
of_log(@"IQ: %@", iq);
}
|