adium 2514:7d7e889ad3af: Patch from mathuaerknedam. Fixes ticket...

commits at adium.im commits at adium.im
Wed Jun 24 20:44:47 UTC 2009


details:	http://hg.adium.im/adium/rev/7d7e889ad3af
revision:	2514:7d7e889ad3af
author:		David Smith <catfish.man at gmail.com>
date:		Wed Jun 24 13:44:30 2009 -0700

Patch from mathuaerknedam. Fixes ticket #9689.

diffs (48 lines):

diff -r 5868ec823062 -r 7d7e889ad3af Plugins/WebKit Message View/AIWebKitMessageViewController.m
--- a/Plugins/WebKit Message View/AIWebKitMessageViewController.m	Sun Jun 21 13:46:58 2009 -0400
+++ b/Plugins/WebKit Message View/AIWebKitMessageViewController.m	Wed Jun 24 13:44:30 2009 -0700
@@ -662,6 +662,7 @@
 	BOOL similar = (previousContent && [content isSimilarToContent:previousContent] && ![content isKindOfClass:[ESFileTransfer class]]);
 	if ([previousContent isKindOfClass:[AIContentStatus class]] && [content isKindOfClass:[AIContentStatus class]] &&
 		[[(AIContentStatus *)previousContent coalescingKey] isEqualToString:[(AIContentStatus *)content coalescingKey]]) {
+		similar = NO;
 		replaceLastContent = YES;
 	}
 
diff -r 5868ec823062 -r 7d7e889ad3af Plugins/WebKit Message View/Template.html
--- a/Plugins/WebKit Message View/Template.html	Sun Jun 21 13:46:58 2009 -0400
+++ b/Plugins/WebKit Message View/Template.html	Wed Jun 24 13:44:30 2009 -0700
@@ -73,28 +73,30 @@
 				appendMessageNoScroll(html);
 			}
 		}
+
 		function replaceLastMessage(html){
 			shouldScroll = nearBottom();
 
 			//Retrieve the current insertion point, then remove it
 			//This requires that there have been an insertion point... is there a better way to retrieve the last element? -evands
 			var insert = document.getElementById("insert");
+			var chat = document.getElementById("Chat");
 			if(insert){
 				var parentNode = insert.parentNode;
-				var lastMessage = insert.previousSibling;
 				parentNode.removeChild(insert);
-				parentNode.removeChild(lastMessage);
+				var lastMessage = chat.lastChild;
+				chat.removeChild(lastMessage);
 			}
 
 			//Now append the message itself
 			var range = document.createRange();
-			var chat = document.getElementById("Chat");
 			range.selectNode(chat);
 			documentFragment = range.createContextualFragment(html);
 			chat.appendChild(documentFragment);
 
 			alignChat(shouldScroll);
 		}
+
 		//Auto-scroll to bottom.  Use nearBottom to determine if a scrollToBottom is desired.
 		function nearBottom() {
 			return ( document.body.scrollTop >= ( document.body.offsetHeight - ( window.innerHeight * 1.2 ) ) );




More information about the commits mailing list