adium 2236:d346422b5e36: Replace remote-<img/> tags with a link ...

commits at adium.im commits at adium.im
Mon May 18 01:25:31 UTC 2009


details:	http://hg.adium.im/adium/rev/d346422b5e36
revision:	2236:d346422b5e36
author:		Zachary West <zacw at adium.im>
date:		Sun May 17 21:25:21 2009 -0400

Replace remote-<img/> tags with a link to their destination. Fixes #11506 (which existed before Evan's change, I think).

diffstat:

 Frameworks/Adium Framework/Source/AIHTMLDecoder.m |  10 +++-------
 1 files changed, 3 insertions(+), 7 deletions(-)

diffs (24 lines):

diff -r 09872cb3bbf7 -r d346422b5e36 Frameworks/Adium Framework/Source/AIHTMLDecoder.m
--- a/Frameworks/Adium Framework/Source/AIHTMLDecoder.m	Sun May 17 20:34:49 2009 -0400
+++ b/Frameworks/Adium Framework/Source/AIHTMLDecoder.m	Sun May 17 21:25:21 2009 -0400
@@ -1821,17 +1821,13 @@
 											  src)];
 			}
 			
-			if (url && ![url isFileURL]) {
-				NSData *data = [NSData dataWithContentsOfURL:url];
-				//Arbitrary image extension; it just needs to have one.
-				src = [[NSTemporaryDirectory() stringByAppendingPathComponent:[NSString randomStringOfLength:8]] stringByAppendingPathExtension:@"png"];
-				[data writeToFile:src
-					   atomically:YES];
-			} else {
+			if (url && [url isFileURL]) {
 				src = [url path];
 				
 				if (inBaseURL && ![[NSFileManager defaultManager] fileExistsAtPath:src])
 					src = [inBaseURL stringByAppendingPathComponent:src];
+			} else {
+				return [NSAttributedString attributedStringWithLinkLabel:src linkDestination:src];
 			}
 
 			[attachment setPath:src];




More information about the commits mailing list