@@ -21,11 +21,19 @@ - (id)init
21
21
{
22
22
if ((self = [super init ]))
23
23
{
24
+ //
24
25
// Configure logging framework
26
+ //
27
+ // The XMPPFramework uses the CocoaLumberjack framework to provide fast & flexible logging.
28
+ // There's tons of information about Lumberjack online:
29
+ // https://github.com/robbiehanson/CocoaLumberjack
30
+ // https://github.com/robbiehanson/CocoaLumberjack/wiki
31
+ //
32
+ // But this one line is all we need to configure the logging framework to dump to the Xcode console.
25
33
26
34
[DDLog addLogger: [DDTTYLogger sharedInstance ]];
27
35
28
- // Initialize variables
36
+ // Initialize xmpp stream and modules
29
37
30
38
xmppStream = [[XMPPStream alloc ] init ];
31
39
@@ -43,6 +51,21 @@ - (id)init
43
51
// xmppPing = [[XMPPPing alloc] init];
44
52
// xmppTime = [[XMPPTime alloc] init];
45
53
54
+ // Activate xmpp modules
55
+
56
+ [xmppReconnect activate: xmppStream];
57
+ [xmppRoster activate: xmppStream];
58
+ [xmppCapabilities activate: xmppStream];
59
+ [xmppPing activate: xmppStream];
60
+ [xmppTime activate: xmppStream];
61
+
62
+ // Add ourself as a delegate to anything we may be interested in
63
+
64
+ [xmppReconnect addDelegate: self delegateQueue: dispatch_get_main_queue ()];
65
+ [xmppCapabilities addDelegate: self delegateQueue: dispatch_get_main_queue ()];
66
+
67
+ // Initialize other stuff
68
+
46
69
turnSockets = [[NSMutableArray alloc ] init ];
47
70
}
48
71
return self;
@@ -52,34 +75,11 @@ - (void)applicationDidFinishLaunching:(NSNotification *)aNotification
52
75
{
53
76
DDLogInfo (@" %@ : %@ " , THIS_FILE, THIS_METHOD);
54
77
55
- [xmppStream addDelegate: self delegateQueue: dispatch_get_main_queue ()];
56
-
57
- // Activate xmpp modules
58
-
59
- [xmppReconnect activate: xmppStream];
60
- [xmppRoster activate: xmppStream];
61
- [xmppCapabilities activate: xmppStream];
62
- [xmppPing activate: xmppStream];
63
- [xmppTime activate: xmppStream];
64
-
65
- // Add ourself as a delegate to anything we may be interested in
66
-
67
- // [xmppStream addDelegate:self delegateQueue:dispatch_get_main_queue()];
68
- [xmppReconnect addDelegate: self delegateQueue: dispatch_get_main_queue ()];
69
- [xmppCapabilities addDelegate: self delegateQueue: dispatch_get_main_queue ()];
70
- [xmppPing addDelegate: self delegateQueue: dispatch_get_main_queue ()];
71
- [xmppTime addDelegate: self delegateQueue: dispatch_get_main_queue ()];
72
-
73
78
// Start the GUI stuff
74
79
75
80
[rosterController displaySignInSheet ];
76
81
}
77
82
78
- - (void )xmppStream : (XMPPStream *)sender didRegisterModule : (id )module
79
- {
80
- DDLogVerbose (@" %@ : xmppStream:didRegisterModule: %@ " , THIS_FILE, module);
81
- }
82
-
83
83
// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
84
84
#pragma mark XEP-0065 Support
85
85
// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
0 commit comments