Permalink
Browse files

Revert "Use new literal syntax"

This reverts commit c17060d.

Conflicts:

	Classes/Controllers/GrowlController.m
	Classes/Dialogs/DCC/DCCFileTransferCell.m
	Classes/IRC/IRCChannel.m
	Classes/Views/KeyRecorder/KeyRecorder.m
  • Loading branch information...
1 parent 2d9e554 commit 4760c511a7600d99fdcfadf65ff9b44058a00f03 @psychs committed Jul 30, 2012
Showing with 1,462 additions and 1,271 deletions.
  1. +12 −0 Classes/Controllers/AppController.h
  2. +37 −47 Classes/Controllers/AppController.m
  3. +203 −0 Classes/Controllers/GrowlController.m
  4. +4 −0 Classes/Controllers/ImageDownloadManager.h
  5. +0 −4 Classes/Controllers/ImageDownloadManager.m
  6. +3 −0 Classes/Controllers/LimeChatApplication.h
  7. +0 −3 Classes/Controllers/LimeChatApplication.m
  8. +25 −0 Classes/Controllers/MenuController.h
  9. +10 −34 Classes/Controllers/MenuController.m
  10. +4 −0 Classes/Controllers/NickCompletinStatus.h
  11. +0 −4 Classes/Controllers/NickCompletinStatus.m
  12. +5 −0 Classes/Controllers/Notifications/GrowlNotificationController.h
  13. +2 −7 Classes/Controllers/Notifications/GrowlNotificationController.m
  14. +3 −0 Classes/Controllers/Notifications/UserNotificationController.h
  15. +1 −4 Classes/Controllers/Notifications/UserNotificationController.m
  16. +4 −0 Classes/Controllers/TwitterAvatarURLManager.h
  17. +5 −9 Classes/Controllers/TwitterAvatarURLManager.m
  18. +8 −0 Classes/Dialogs/ChannelDialog.h
  19. +0 −9 Classes/Dialogs/ChannelDialog.m
  20. +16 −0 Classes/Dialogs/DCC/DCCController.h
  21. +17 −33 Classes/Dialogs/DCC/DCCController.m
  22. +13 −0 Classes/Dialogs/DCC/DCCFileTransferCell.h
  23. +12 −25 Classes/Dialogs/DCC/DCCFileTransferCell.m
  24. +21 −0 Classes/Dialogs/DCC/DCCReceiver.h
  25. +0 −21 Classes/Dialogs/DCC/DCCReceiver.m
  26. +20 −0 Classes/Dialogs/DCC/DCCSender.h
  27. +1 −21 Classes/Dialogs/DCC/DCCSender.m
  28. +4 −0 Classes/Dialogs/IgnoreItemSheet.h
  29. +2 −7 Classes/Dialogs/IgnoreItemSheet.m
  30. +3 −0 Classes/Dialogs/InviteSheet.h
  31. +4 −8 Classes/Dialogs/InviteSheet.m
  32. +6 −0 Classes/Dialogs/ListDialog.h
  33. +17 −24 Classes/Dialogs/ListDialog.m
  34. +5 −0 Classes/Dialogs/ModeSheet.h
  35. +0 −6 Classes/Dialogs/ModeSheet.m
  36. +2 −0 Classes/Dialogs/NickSheet.h
  37. +0 −3 Classes/Dialogs/NickSheet.m
  38. +12 −0 Classes/Dialogs/PasteSheet.h
  39. +26 −38 Classes/Dialogs/PasteSheet.m
  40. +19 −0 Classes/Dialogs/Preferences/PreferencesController.h
  41. +5 −24 Classes/Dialogs/Preferences/PreferencesController.m
  42. +3 −0 Classes/Dialogs/Preferences/SoundWrapper.h
  43. +0 −3 Classes/Dialogs/Preferences/SoundWrapper.m
  44. +8 −0 Classes/Dialogs/ServerDialog.h
  45. +12 −21 Classes/Dialogs/ServerDialog.m
  46. +3 −0 Classes/Dialogs/SheetBase.h
  47. +0 −4 Classes/Dialogs/SheetBase.m
  48. +3 −0 Classes/Dialogs/TopicSheet.h
  49. +0 −4 Classes/Dialogs/TopicSheet.m
  50. +3 −0 Classes/Dialogs/WelcomeDialog.h
  51. +18 −22 Classes/Dialogs/WelcomeDialog.m
  52. +4 −0 Classes/Dialogs/WhoisDialog.h
  53. +0 −5 Classes/Dialogs/WhoisDialog.m
  54. +1 −1 Classes/Helpers/NSArrayHelper.m
  55. +20 −21 Classes/Helpers/NSColorHelper.m
  56. +11 −11 Classes/Helpers/NSDictionaryHelper.m
  57. +1 −1 Classes/Helpers/NSLocaleHelper.m
  58. +2 −2 Classes/Helpers/NSPasteboardHelper.m
  59. +1 −1 Classes/Helpers/NSStringHelper.m
  60. +1 −1 Classes/Helpers/URLOpener.m
  61. +21 −0 Classes/IRC/IRCChannel.h
  62. +11 −32 Classes/IRC/IRCChannel.m
  63. +15 −0 Classes/IRC/IRCChannelConfig.h
  64. +9 −24 Classes/IRC/IRCChannelConfig.m
  65. +14 −0 Classes/IRC/IRCChannelMode.h
  66. +0 −14 Classes/IRC/IRCChannelMode.m
  67. +55 −0 Classes/IRC/IRCClient.h
  68. +17 −72 Classes/IRC/IRCClient.m
  69. +39 −0 Classes/IRC/IRCClientConfig.h
  70. +20 −59 Classes/IRC/IRCClientConfig.m
  71. +23 −0 Classes/IRC/IRCConnection.h
  72. +1 −24 Classes/IRC/IRCConnection.m
  73. +12 −0 Classes/IRC/IRCISupportInfo.h
  74. +1 −13 Classes/IRC/IRCISupportInfo.m
  75. +7 −0 Classes/IRC/IRCMessage.h
  76. +2 −9 Classes/IRC/IRCMessage.m
  77. +7 −0 Classes/IRC/IRCPrefix.h
  78. +0 −7 Classes/IRC/IRCPrefix.m
  79. +7 −0 Classes/IRC/IRCSendingMessage.h
  80. +2 −9 Classes/IRC/IRCSendingMessage.m
  81. +7 −0 Classes/IRC/IRCTreeItem.h
  82. +0 −7 Classes/IRC/IRCTreeItem.m
  83. +18 −0 Classes/IRC/IRCUser.h
  84. +0 −18 Classes/IRC/IRCUser.m
  85. +9 −0 Classes/IRC/IRCUserMode.h
  86. +0 −9 Classes/IRC/IRCUserMode.m
  87. +38 −0 Classes/IRC/IRCWorld.h
  88. +20 −58 Classes/IRC/IRCWorld.m
  89. +4 −0 Classes/IRC/IRCWorldConfig.h
  90. +3 −7 Classes/IRC/IRCWorldConfig.m
  91. +10 −0 Classes/IRC/IgnoreItem.h
  92. +9 −19 Classes/IRC/IgnoreItem.m
  93. +5 −0 Classes/IRC/TimerCommand.h
  94. +0 −5 Classes/IRC/TimerCommand.m
  95. +32 −0 Classes/Library/AsyncSocket.h
  96. +42 −78 Classes/Library/AsyncSocket.m
  97. +7 −0 Classes/Library/FileLogger.h
  98. +0 −7 Classes/Library/FileLogger.m
  99. +12 −0 Classes/Library/GistClient.h
  100. +7 −19 Classes/Library/GistClient.m
  101. +3 −0 Classes/Library/HostResolver.h
  102. +3 −6 Classes/Library/HostResolver.m
  103. +3 −0 Classes/Library/HotKeyManager.h
  104. +0 −3 Classes/Library/HotKeyManager.m
  105. +4 −0 Classes/Library/IconController.h
  106. +0 −4 Classes/Library/IconController.m
  107. +11 −0 Classes/Library/ImageSizeCheckClient.h
  108. +1 −12 Classes/Library/ImageSizeCheckClient.m
  109. +4 −0 Classes/Library/InputHistory.h
  110. +4 −8 Classes/Library/InputHistory.m
  111. +5 −0 Classes/Library/KeyEventHandler.h
  112. +13 −18 Classes/Library/KeyEventHandler.m
  113. +23 −0 Classes/Library/TCPClient.h
  114. +0 −23 Classes/Library/TCPClient.m
  115. +8 −0 Classes/Library/TCPServer.h
  116. +0 −8 Classes/Library/TCPServer.m
  117. +6 −0 Classes/Library/Timer.h
  118. +0 −6 Classes/Library/Timer.m
  119. +8 −0 Classes/Library/TwitterImageURLClient.h
  120. +0 −8 Classes/Library/TwitterImageURLClient.m
  121. +4 −4 Classes/Library/YAML/SyckInput.m
  122. +4 −0 Classes/Library/YAML/YAMLCategories.h
  123. +12 −14 Classes/Library/YAML/YAMLCategories.m
  124. +4 −0 Classes/Preferences/CustomJSFile.h
  125. +0 −4 Classes/Preferences/CustomJSFile.m
  126. +5 −0 Classes/Preferences/LogTheme.h
  127. +0 −5 Classes/Preferences/LogTheme.m
  128. +39 −0 Classes/Preferences/OtherTheme.h
  129. +9 −48 Classes/Preferences/OtherTheme.m
  130. +3 −3 Classes/Preferences/Preferences.m
  131. +6 −0 Classes/Preferences/ViewTheme.h
  132. +3 −9 Classes/Preferences/ViewTheme.m
  133. +4 −0 Classes/Views/FieldEditorTextView.h
  134. +0 −4 Classes/Views/FieldEditorTextView.m
  135. +1 −1 Classes/Views/InputTextField.m
  136. +4 −0 Classes/Views/KeyRecorder/KeyCodeTranslator.h
  137. +0 −4 Classes/Views/KeyRecorder/KeyCodeTranslator.m
  138. +9 −0 Classes/Views/KeyRecorder/KeyRecorder.h
  139. +2 −12 Classes/Views/KeyRecorder/KeyRecorder.m
  140. +4 −0 Classes/Views/ListView.h
  141. +0 −4 Classes/Views/ListView.m
  142. +4 −4 Classes/Views/Log/ImageURLParser.m
  143. +36 −0 Classes/Views/Log/LogController.h
  144. +11 −47 Classes/Views/Log/LogController.m
  145. +15 −0 Classes/Views/Log/LogLine.h
  146. +0 −15 Classes/Views/Log/LogLine.m
  147. +12 −0 Classes/Views/Log/LogPolicy.h
  148. +3 −15 Classes/Views/Log/LogPolicy.m
  149. +8 −0 Classes/Views/Log/LogScriptEventSink.h
  150. +0 −8 Classes/Views/Log/LogScriptEventSink.m
  151. +4 −0 Classes/Views/Log/LogView.h
  152. +0 −4 Classes/Views/Log/LogView.m
  153. +5 −0 Classes/Views/Log/WebViewAutoScroll.h
  154. +0 −5 Classes/Views/Log/WebViewAutoScroll.m
  155. +3 −0 Classes/Views/MainWindow.h
  156. +0 −3 Classes/Views/MainWindow.m
  157. +4 −0 Classes/Views/MarkedScroller.h
  158. +0 −4 Classes/Views/MarkedScroller.m
  159. +9 −0 Classes/Views/MemberList/MemberListView.h
  160. +1 −10 Classes/Views/MemberList/MemberListView.m
  161. +3 −0 Classes/Views/MemberList/MemberListViewCell.h
  162. +8 −11 Classes/Views/MemberList/MemberListViewCell.m
  163. +9 −0 Classes/Views/ServerTreeView.h
  164. +0 −9 Classes/Views/ServerTreeView.m
  165. +7 −0 Classes/Views/ThinSplitView.h
  166. +0 −7 Classes/Views/ThinSplitView.m
  167. +3 −0 Classes/Views/TreeView.h
  168. +0 −3 Classes/Views/TreeView.m
@@ -45,6 +45,18 @@
IBOutlet NSMenu* urlMenu;
IBOutlet NSMenu* addrMenu;
IBOutlet NSMenu* chanMenu;
+
+ WelcomeDialog* welcomeDialog;
+ id<NotificationController> notifier;
+ DCCController* dcc;
+ FieldEditorTextView* fieldEditor;
+ IRCWorld* world;
+ ViewTheme* viewTheme;
+ InputHistory* inputHistory;
+ NickCompletinStatus* completionStatus;
+
+ BOOL threeColumns;
+ BOOL terminating;
}
@end
@@ -24,19 +24,6 @@
@implementation AppController
-{
- WelcomeDialog* welcomeDialog;
- id<NotificationController> notifier;
- DCCController* dcc;
- FieldEditorTextView* fieldEditor;
- IRCWorld* world;
- ViewTheme* viewTheme;
- InputHistory* inputHistory;
- NickCompletinStatus* completionStatus;
-
- BOOL threeColumns;
- BOOL terminating;
-}
- (void)dealloc
{
@@ -448,7 +435,7 @@ - (void)loadWindowState
int y = [dic intForKey:@"y"];
int w = [dic intForKey:@"w"];
int h = [dic intForKey:@"h"];
- id spellCheckingValue = dic[@"spell_checking"];
+ id spellCheckingValue = [dic objectForKey:@"spell_checking"];
[window setFrame:NSMakeRect(x, y, w, h) display:YES];
rootSplitter.position = [dic intForKey:@"root"];
@@ -606,15 +593,18 @@ - (void)completeNick:(BOOL)forward
CGFloat firstUserWeight = 0;
if (commandMode) {
- lowerChoices = @[@"action", @"away", @"ban", @"clear", @"close",
- @"ctcp", @"ctcpreply", @"cycle", @"dehalfop", @"deop",
- @"devoice", @"halfop", @"hop", @"ignore", @"invite",
- @"ison", @"join", @"kick", @"leave", @"list",
- @"me", @"mode", @"msg", @"nick", @"notice",
- @"op", @"part", @"pong", @"privmsg", @"query",
- @"quit", @"quote", @"raw", @"rejoin", @"timer",
- @"topic", @"umode", @"unban", @"unignore", @"voice",
- @"weights", @"who", @"whois", @"whowas"];
+ choices = [NSArray arrayWithObjects:
+ @"action", @"away", @"ban", @"clear", @"close",
+ @"ctcp", @"ctcpreply", @"cycle", @"dehalfop", @"deop",
+ @"devoice", @"halfop", @"hop", @"ignore", @"invite",
+ @"ison", @"join", @"kick", @"leave", @"list",
+ @"me", @"mode", @"msg", @"nick", @"notice",
+ @"op", @"part", @"pong", @"privmsg", @"query",
+ @"quit", @"quote", @"raw", @"rejoin", @"timer",
+ @"topic", @"umode", @"unban", @"unignore", @"voice",
+ @"weights", @"who", @"whois", @"whowas",
+ nil];
+ lowerChoices = choices;
}
else {
NSMutableArray* users = [[channel.members mutableCopy] autorelease];
@@ -645,7 +635,7 @@ - (void)completeNick:(BOOL)forward
int i = 0;
for (NSString* s in lowerChoices) {
if ([s hasPrefix:lowerPre]) {
- [currentChoices addObject:choices[i]];
+ [currentChoices addObject:[choices objectAtIndex:i]];
[currentLowerChoices addObject:s];
}
++i;
@@ -657,7 +647,7 @@ - (void)completeNick:(BOOL)forward
if (!currentChoices.count) {
if (current.length) return;
if (!commandMode && !twitterMode && firstUserWeight > 0) {
- NSString* firstChoice = choices[0];
+ NSString* firstChoice = [choices objectAtIndex:0];
[currentChoices addObject:firstChoice];
[currentLowerChoices addObject:[firstChoice lowercaseString]];
}
@@ -684,10 +674,10 @@ - (void)completeNick:(BOOL)forward
--index;
}
}
- t = currentChoices[index];
+ t = [currentChoices objectAtIndex:index];
}
else {
- t = currentChoices[0];
+ t = [currentChoices objectAtIndex:0];
}
// add suffix
@@ -852,7 +842,7 @@ - (void)move:(MoveKind)dir target:(MoveKind)target
if (n == start) break;
- client = world.clients[n];
+ client = [world.clients objectAtIndex:n];
if (client) {
if (target == MOVE_ACTIVE) {
if (client.isLoggedIn) {
@@ -1069,7 +1059,7 @@ - (void)registerKeyHandlers
- (void)welcomeDialog:(WelcomeDialog*)sender onOK:(NSDictionary*)config
{
- NSString* host = config[@"host"];
+ NSString* host = [config objectForKey:@"host"];
NSString* name = host;
NSString* hostPattern = @"^[^\\s]+\\s+\\(([^()]+)\\)";
@@ -1079,29 +1069,29 @@ - (void)welcomeDialog:(WelcomeDialog*)sender onOK:(NSDictionary*)config
name = [host substringWithRange:[result rangeAtIndex:1]];
}
- NSString* nick = config[@"nick"];
+ NSString* nick = [config objectForKey:@"nick"];
NSString* user = [[nick lowercaseString] safeUsername];
NSString* realName = nick;
NSMutableArray* channels = [NSMutableArray array];
- for (NSString* s in config[@"channels"]) {
- [channels addObject:@{
- @"name": s,
- @"auto_join": @YES,
- @"console": @YES,
- @"growl": @YES,
- @"mode": @"+sn",
- }];
+ for (NSString* s in [config objectForKey:@"channels"]) {
+ [channels addObject:[NSDictionary dictionaryWithObjectsAndKeys:
+ s, @"name",
+ [NSNumber numberWithBool:YES], @"auto_join",
+ [NSNumber numberWithBool:YES], @"console",
+ [NSNumber numberWithBool:YES], @"growl",
+ @"+sn", @"mode",
+ nil]];
}
NSMutableDictionary* dic = [NSMutableDictionary dictionary];
- dic[@"host"] = host;
- dic[@"name"] = name;
- dic[@"nick"] = nick;
- dic[@"username"] = user;
- dic[@"realname"] = realName;
- dic[@"channels"] = channels;
- dic[@"auto_connect"] = config[@"autoConnect"];
+ [dic setObject:host forKey:@"host"];
+ [dic setObject:name forKey:@"name"];
+ [dic setObject:nick forKey:@"nick"];
+ [dic setObject:user forKey:@"username"];
+ [dic setObject:realName forKey:@"realname"];
+ [dic setObject:channels forKey:@"channels"];
+ [dic setObject:[config objectForKey:@"autoConnect"] forKey:@"auto_connect"];
if ([NSLocale prefersJapaneseLanguage]) {
NSString* net = [host lowercaseString];
@@ -1110,10 +1100,10 @@ - (void)welcomeDialog:(WelcomeDialog*)sender onOK:(NSDictionary*)config
|| [net contains:@"quakenet"]
|| [net contains:@"mozilla"]
|| [net contains:@"ustream"]) {
- dic[@"encoding"] = [NSNumber numberWithLong:NSUTF8StringEncoding];
+ [dic setObject:[NSNumber numberWithLong:NSUTF8StringEncoding] forKey:@"encoding"];
}
else {
- dic[@"encoding"] = [NSNumber numberWithLong:NSISO2022JPStringEncoding];
+ [dic setObject:[NSNumber numberWithLong:NSISO2022JPStringEncoding] forKey:@"encoding"];
}
}
@@ -0,0 +1,203 @@
+// LimeChat is copyrighted free software by Satoshi Nakagawa <psychs AT limechat DOT net>.
+// You can redistribute it and/or modify it under the terms of the GPL version 2 (see the file GPL.txt).
+
+#import "GrowlController.h"
+#import "IRCWorld.h"
+#import "Preferences.h"
+
+
+#define GROWL_MSG_LOGIN @"Logged in"
+#define GROWL_MSG_DISCONNECT @"Disconnected"
+#define GROWL_MSG_HIGHLIGHT @"Highlight message received"
+#define GROWL_MSG_NEW_TALK @"New private message started"
+#define GROWL_MSG_CHANNEL_MSG @"Channel message received"
+#define GROWL_MSG_CHANNEL_NOTICE @"Channel notice received"
+#define GROWL_MSG_TALK_MSG @"Private message received"
+#define GROWL_MSG_TALK_NOTICE @"Private notice received"
+#define GROWL_MSG_KICKED @"Kicked out from channel"
+#define GROWL_MSG_INVITED @"Invited to channel"
+#define GROWL_MSG_FILE_RECEIVE_REQUEST @"File receive requested"
+#define GROWL_MSG_FILE_RECEIVE_SUCCEEDED @"File receive succeeded"
+#define GROWL_MSG_FILE_RECEIVE_FAILED @"File receive failed"
+#define GROWL_MSG_FILE_SEND_SUCCEEDED @"File send succeeded"
+#define GROWL_NSG_FILE_SEND_FAILED @"File send failed"
+
+#define CLICK_INTERVAL 2
+
+
+@implementation GrowlController
+
+@synthesize owner;
+
+- (id)init
+{
+ self = [super init];
+ if (self) {
+ [GrowlApplicationBridge setGrowlDelegate:self];
+ }
+ return self;
+}
+
+- (void)dealloc
+{
+ [lastClickedContext release];
+ [super dealloc];
+}
+
+- (void)notify:(GrowlNotificationType)type title:(NSString*)title desc:(NSString*)desc context:(id)context
+{
+ if (![Preferences growlEnabledForEvent:type]) return;
+
+ int priority = 0;
+ BOOL sticky = [Preferences growlStickyForEvent:type];
+ NSString* kind = nil;
+
+ switch (type) {
+ case GROWL_HIGHLIGHT:
+ kind = GROWL_MSG_HIGHLIGHT;
+ priority = 1;
+ title = [NSString stringWithFormat:@"Highlight: %@", title];
+ break;
+ case GROWL_NEW_TALK:
+ kind = GROWL_MSG_NEW_TALK;
+ priority = 1;
+ title = @"New Private Message";
+ break;
+ case GROWL_CHANNEL_MSG:
+ kind = GROWL_MSG_CHANNEL_MSG;
+ break;
+ case GROWL_CHANNEL_NOTICE:
+ kind = GROWL_MSG_CHANNEL_NOTICE;
+ title = [NSString stringWithFormat:@"Notice: %@", title];
+ break;
+ case GROWL_TALK_MSG:
+ kind = GROWL_MSG_TALK_MSG;
+ title = @"Private Message";
+ break;
+ case GROWL_TALK_NOTICE:
+ kind = GROWL_MSG_TALK_NOTICE;
+ title = @"Private Notice";
+ break;
+ case GROWL_KICKED:
+ kind = GROWL_MSG_KICKED;
+ title = [NSString stringWithFormat:@"Kicked: %@", title];
+ break;
+ case GROWL_INVITED:
+ kind = GROWL_MSG_INVITED;
+ title = [NSString stringWithFormat:@"Invited: %@", title];
+ break;
+ case GROWL_LOGIN:
+ kind = GROWL_MSG_LOGIN;
+ title = [NSString stringWithFormat:@"Logged in: %@", title];
+ break;
+ case GROWL_DISCONNECT:
+ kind = GROWL_MSG_DISCONNECT;
+ title = [NSString stringWithFormat:@"Disconnected: %@", title];
+ break;
+ case GROWL_FILE_RECEIVE_REQUEST:
+ kind = GROWL_MSG_FILE_RECEIVE_REQUEST;
+ desc = [NSString stringWithFormat:@"From %@\n%@", title, desc];
+ title = @"File receive request";
+ context = @"dcc";
+ break;
+ case GROWL_FILE_RECEIVE_SUCCESS:
+ kind = GROWL_MSG_FILE_RECEIVE_SUCCEEDED;
+ desc = [NSString stringWithFormat:@"From %@\n%@", title, desc];
+ title = @"File receive succeeded";
+ context = @"dcc";
+ break;
+ case GROWL_FILE_RECEIVE_ERROR:
+ kind = GROWL_MSG_FILE_RECEIVE_FAILED;
+ desc = [NSString stringWithFormat:@"From %@\n%@", title, desc];
+ title = @"File receive failed";
+ context = @"dcc";
+ break;
+ case GROWL_FILE_SEND_SUCCESS:
+ kind = GROWL_MSG_FILE_SEND_SUCCEEDED;
+ desc = [NSString stringWithFormat:@"To %@\n%@", title, desc];
+ title = @"File send succeeded";
+ context = @"dcc";
+ break;
+ case GROWL_FILE_SEND_ERROR:
+ kind = GROWL_NSG_FILE_SEND_FAILED;
+ desc = [NSString stringWithFormat:@"To %@\n%@", title, desc];
+ title = @"File send failed";
+ context = @"dcc";
+ break;
+ default:
+ break;
+ }
+
+
+ [GrowlApplicationBridge notifyWithTitle:title
+ description:desc
+ notificationName:kind
+ iconData:nil
+ priority:priority
+ isSticky:sticky
+ clickContext:context];
+}
+
+- (NSDictionary*)registrationDictionaryForGrowl
+{
+ NSMutableDictionary* dic = [NSMutableDictionary dictionary];
+ NSArray* all = [NSArray arrayWithObjects:
+ GROWL_MSG_LOGIN, GROWL_MSG_DISCONNECT, GROWL_MSG_HIGHLIGHT,
+ GROWL_MSG_NEW_TALK, GROWL_MSG_CHANNEL_MSG, GROWL_MSG_CHANNEL_NOTICE,
+ GROWL_MSG_TALK_MSG, GROWL_MSG_TALK_NOTICE, GROWL_MSG_KICKED,
+ GROWL_MSG_INVITED, GROWL_MSG_FILE_RECEIVE_REQUEST, GROWL_MSG_FILE_RECEIVE_SUCCEEDED,
+ GROWL_MSG_FILE_RECEIVE_FAILED, GROWL_MSG_FILE_SEND_SUCCEEDED, GROWL_NSG_FILE_SEND_FAILED,
+ nil];
+ [dic setObject:all forKey:GROWL_NOTIFICATIONS_ALL];
+ [dic setObject:all forKey:GROWL_NOTIFICATIONS_DEFAULT];
+ return dic;
+}
+
+- (void)growlNotificationWasClicked:(id)context
+{
+ CFAbsoluteTime now = CFAbsoluteTimeGetCurrent();
+
+ if (now - lastClickedTime < CLICK_INTERVAL) {
+ if (lastClickedContext && [lastClickedContext isEqual:context]) {
+ return;
+ }
+ }
+
+ lastClickedTime = now;
+ [lastClickedContext release];
+ lastClickedContext = [context retain];
+
+ [owner.window makeKeyAndOrderFront:nil];
+ [NSApp activateIgnoringOtherApps:YES];
+
+ if ([context isEqualToString:@"dcc"]) {
+ [owner.dcc show:YES];
+ }
+ else if ([context isKindOfClass:[NSString class]]) {
+ NSString* s = context;
+ NSArray* ary = [s componentsSeparatedByString:@" "];
+ if (ary.count >= 2) {
+ int uid = [[ary objectAtIndex:0] intValue];
+ int cid = [[ary objectAtIndex:1] intValue];
+
+ IRCClient* u = [owner findClientById:uid];
+ IRCChannel* c = [owner findChannelByClientId:uid channelId:cid];
+ if (c) {
+ [owner select:c];
+ }
+ else if (u) {
+ [owner select:u];
+ }
+ }
+ else if (ary.count == 1) {
+ int uid = [[ary objectAtIndex:0] intValue];
+
+ IRCClient* u = [owner findClientById:uid];
+ if (u) {
+ [owner select:u];
+ }
+ }
+ }
+}
+
+@end
@@ -7,6 +7,10 @@
@interface ImageDownloadManager : NSObject
+{
+ __weak IRCWorld* world;
+ NSMutableSet* checkers;
+}
@property (nonatomic, weak) IRCWorld* world;
Oops, something went wrong.

0 comments on commit 4760c51

Please sign in to comment.