--- a/Plugins/Purple Service/CBPurpleOscarAccount.m Thu Sep 13 11:11:17 2012 +0200
+++ b/Plugins/Purple Service/CBPurpleOscarAccount.m Thu Sep 13 11:16:24 2012 +0200
@@ -427,26 +427,26 @@
- (NSString *)encodedAttributedString:(NSAttributedString *)inAttributedString forListObject:(AIListObject *)inListObject
- static AIHTMLDecoder * encoderCloseFontTagsAttachmentsAsText = nil;
- if(!encoderCloseFontTagsAttachmentsAsText) {
- AIHTMLDecoder *newEncoder = [[AIHTMLDecoder alloc] initWithHeaders:YES
- onlyIncludeOutgoingImages:YES
- allowJavascriptURLs:YES];
- OSAtomicCompareAndSwapPtrBarrier(nil, (__bridge void*)newEncoder, (void *)&encoderCloseFontTagsAttachmentsAsText);
- [encoderCloseFontTagsAttachmentsAsText setAllowAIMsubprofileLinks:YES];
- return ([inAttributedString length] ? [encoderCloseFontTagsAttachmentsAsText encodeHTML:inAttributedString imagesPath:nil] : nil);
+ static AIHTMLDecoder *encoderCloseFontTagsAttachmentsAsText = nil; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + encoderCloseFontTagsAttachmentsAsText = [[AIHTMLDecoder alloc] initWithHeaders:YES + onlyIncludeOutgoingImages:YES + allowJavascriptURLs:YES]; + [encoderCloseFontTagsAttachmentsAsText setAllowAIMsubprofileLinks:YES]; + return ([inAttributedString length] ? [encoderCloseFontTagsAttachmentsAsText encodeHTML:inAttributedString imagesPath:nil] : nil); - (NSString *)encodedAttributedStringForSendingContentMessage:(AIContentMessage *)inContentMessage