adium 2437:80efb0a2c258: Fix posting Growl notifications when ei...

commits at adium.im commits at adium.im
Mon Jun 1 17:54:34 UTC 2009


details:	http://hg.adium.im/adium/rev/80efb0a2c258
revision:	2437:80efb0a2c258
author:		Zachary West <zacw at adium.im>
date:		Mon Jun 01 13:53:45 2009 -0400

Fix posting Growl notifications when either userinfo, details or listobject are nil. Whoops!

diffs (38 lines):

diff -r 3edab11827ca -r 80efb0a2c258 Source/NEHGrowlPlugin.m
--- a/Source/NEHGrowlPlugin.m	Sun May 31 17:02:31 2009 -0700
+++ b/Source/NEHGrowlPlugin.m	Mon Jun 01 13:53:45 2009 -0400
@@ -212,20 +212,29 @@
 	if (!events)
 		events = [NSMutableArray array];
 	
-	[events addObject:[NSMutableDictionary dictionaryWithObjectsAndKeys:
-						  listObject, @"AIListObject",
-						  details, @"Details",
-						  userInfo, @"UserInfo", nil]];
+	NSMutableDictionary *eventDetails = [NSMutableDictionary dictionary];
+	
+	if (listObject)
+		[eventDetails setValue:listObject forKey:@"AIListObject"];
+	
+	if (userInfo)
+		[eventDetails setValue:userInfo forKey:@"UserInfo"];
+	
+	if (details)
+		[eventDetails setValue:details forKey:@"Details"];
+	
+	[events addObject:eventDetails];
 	
 	[queuedEvents setValue:events forKey:queueKey];
 	
 	// wtb cancelPreviousPerformRequestsWithTarget:selector:object:object:
+	// chat may be nil
 	NSDictionary *queueCall = [NSDictionary dictionaryWithObjectsAndKeys:eventID, @"EventID", chat, @"AIChat", nil];
 	
 	// Trigger the queue to be cleared in GROWL_QUEUE_WAIT seconds.
 	[NSObject cancelPreviousPerformRequestsWithTarget:self
 											 selector:@selector(clearQueue:)
-											   object:[NSDictionary dictionaryWithObjectsAndKeys:eventID, @"EventID", chat, @"AIChat", nil]];
+											   object:queueCall];
 	
 	[self performSelector:@selector(clearQueue:)
 			   withObject:queueCall




More information about the commits mailing list