--- a/Frameworks/Adium Framework/Source/AIMessageEntryTextView.m Tue Aug 13 00:24:57 2013 +0200
+++ b/Frameworks/Adium Framework/Source/AIMessageEntryTextView.m Thu Oct 10 02:24:58 2013 +0200
@@ -35,6 +35,7 @@
#import <AIUtilities/AIPasteboardAdditions.h>
#import <AIUtilities/AIBezierPathAdditions.h>
#import <Adium/AIContactControllerProtocol.h>
+#import <WebKit/WebKit.h> #import <FriBidi/NSString-FBAdditions.h>
@@ -507,6 +508,13 @@
+// Forbid loading the images embedded in a string when pasting. +// They are very unlikely to work and a privacy issue. +- (NSURLRequest *)webView:(WebView *)sender resource:(id)identifier willSendRequest:(NSURLRequest *)request redirectResponse:(NSURLResponse *)redirectResponse fromDataSource:(WebDataSource *)dataSource - (BOOL)handlePasteAsRichText
NSPasteboard *generalPasteboard = [NSPasteboard generalPasteboard];
@@ -526,6 +534,14 @@
} else if ([FILES_AND_IMAGES_TYPES containsObject:type]) {
[self addAttachmentsFromPasteboard:generalPasteboard];
+ } else if ([type isEqualToString:NSHTMLPboardType]) { + NSData *htmlData = [generalPasteboard dataForType:NSHTMLPboardType]; + [self insertText:[[[NSAttributedString alloc] initWithData:htmlData + options:@{NSDocumentTypeDocumentAttribute: NSHTMLTextDocumentType, + NSCharacterEncodingDocumentAttribute: @(NSUTF8StringEncoding), + NSWebResourceLoadDelegateDocumentOption: self} + documentAttributes:NULL error:NULL] autorelease]];