--- a/Plugins/Purple Service/AIPurpleCertificateTrustWarningAlert.m Tue Jun 25 21:29:29 2013 +0200
+++ b/Plugins/Purple Service/AIPurpleCertificateTrustWarningAlert.m Tue Jun 25 21:49:22 2013 +0200
@@ -26,8 +26,6 @@
//#define ALWAYS_SHOW_TRUST_WARNING
-static NSMutableDictionary *acceptedCertificates = nil;
@interface AIPurpleCertificateTrustWarningAlert ()
- (id)initWithAccount:(AIAccount*)account
hostname:(NSString*)hostname
@@ -76,8 +74,6 @@
if((self = [super init])) {
- if(!acceptedCertificates)
- acceptedCertificates = [[NSMutableDictionary alloc] init];
query_cert_cb = _query_cert_cb;
@@ -107,23 +103,6 @@
err = SecCertificateGetData((SecCertificateRef)CFArrayGetValueAtIndex(certificates, 0), &data);
- // Did we ask the user to confirm this certificate before?
- // Note that this information is not stored on the disk, which is on purpose.
- NSUInteger oldCertHash = [[acceptedCertificates objectForKey:hostname] unsignedIntegerValue];
- NSData *certData = [[NSData alloc] initWithBytesNoCopy:data.Data length:data.Length freeWhenDone:NO];
- NSUInteger newCertHash = [certData hash];
- if (oldCertHash == newCertHash) {
- query_cert_cb(true, userdata);
err = SecPolicySearchCreate(CSSM_CERT_X_509v3, &CSSMOID_APPLE_TP_SSL, NULL, &searchRef);
@@ -272,7 +251,7 @@
didEndSelector:@selector(certificateTrustSheetDidEnd:returnCode:contextInfo:)
@@ -286,17 +265,6 @@
NSWindow *parentWindow = (NSWindow *)contextInfo;
query_cert_cb(didTrustCerficate, userdata);
- /* If the user confirmed this cert, we store this information until the app is closed so the user doesn't have to re-confirm it every time
- * (doing otherwise might be particularily annoying on auto-reconnect)
- if (didTrustCerficate) {
- OSStatus err = SecCertificateGetData((SecCertificateRef)CFArrayGetValueAtIndex(certificates, 0), &certdata);
- [acceptedCertificates setObject:[NSNumber numberWithUnsignedInteger:[[NSData dataWithBytes:certdata.Data length:certdata.Length] hash]]
--- a/Plugins/Twitter Plugin/AITwitterAccount.m Tue Jun 25 21:29:29 2013 +0200
+++ b/Plugins/Twitter Plugin/AITwitterAccount.m Tue Jun 25 21:49:22 2013 +0200
@@ -1036,37 +1036,45 @@
[listContact setValue:[NSNumber numberWithBool:YES] forProperty:TWITTER_PROPERTY_REQUESTED_USER_ICON notify:NotifyNever];
static dispatch_semaphore_t imageDownloadSemaphore;
+ static dispatch_queue_t imageDownloadScheduleQueue; static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
imageDownloadSemaphore = dispatch_semaphore_create(16);
+ imageDownloadScheduleQueue = dispatch_queue_create("im.adium.AITwitterAccount.imageDownloadScheduleQueue", NULL); + dispatch_set_target_queue(imageDownloadScheduleQueue, dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_LOW, 0)); - // Grab the user icon and set it as their serverside icon.
- dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_LOW, 0), ^{
- NSString *imageURL = [url stringByReplacingOccurrencesOfString:@"_normal." withString:@"_bigger."];
- NSURLRequest *imageRequest = [NSURLRequest requestWithURL:[NSURL URLWithString:imageURL]];
+ dispatch_async(imageDownloadScheduleQueue, ^{ dispatch_semaphore_wait(imageDownloadSemaphore, DISPATCH_TIME_FOREVER);
- NSData *data = [NSURLConnection sendSynchronousRequest:imageRequest returningResponse:nil error:&error];
- dispatch_semaphore_signal(imageDownloadSemaphore);
- NSImage *image = [[[NSImage alloc] initWithData:data] autorelease];
- dispatch_async(dispatch_get_main_queue(), ^{
- AILogWithSignature(@"%@ Updated user icon for %@", self, listContact);
- [listContact setServersideIconData:[image TIFFRepresentation]
- [listContact setValue:nil forProperty:TWITTER_PROPERTY_REQUESTED_USER_ICON notify:NotifyNever];
- [listContact setValue:url forProperty:TWITTER_PROPERTY_USER_ICON_URL afterDelay:NotifyNever];
- dispatch_async(dispatch_get_main_queue(), ^{
- [self requestFailed:AITwitterUserIconPull withError:error userInfo:@{ @"ListContact" : listContact }];
+ // Grab the user icon and set it as their serverside icon. + dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_LOW, 0), ^{ + NSString *imageURL = [url stringByReplacingOccurrencesOfString:@"_normal." withString:@"_bigger."]; + NSURLRequest *imageRequest = [NSURLRequest requestWithURL:[NSURL URLWithString:imageURL]]; + NSData *data = [NSURLConnection sendSynchronousRequest:imageRequest returningResponse:nil error:&error]; + NSImage *image = [[[NSImage alloc] initWithData:data] autorelease]; + dispatch_async(dispatch_get_main_queue(), ^{ + AILogWithSignature(@"%@ Updated user icon for %@", self, listContact); + [listContact setServersideIconData:[image TIFFRepresentation] + [listContact setValue:nil forProperty:TWITTER_PROPERTY_REQUESTED_USER_ICON notify:NotifyNever]; + [listContact setValue:url forProperty:TWITTER_PROPERTY_USER_ICON_URL afterDelay:NotifyNever]; + dispatch_async(dispatch_get_main_queue(), ^{ + [self requestFailed:AITwitterUserIconPull withError:error userInfo:@{ @"ListContact" : listContact }]; + dispatch_semaphore_signal(imageDownloadSemaphore);