adium 3833:742a577f459c: Fix focussing of messages:

commits at adium.im commits at adium.im
Sat Apr 2 10:37:27 UTC 2011


details:	http://hg.adium.im/adium/rev/742a577f459c
revision:	3833:742a577f459c
branch:		(none)
author:		Thijs Alkemade <thijsalkemade at gmail.com>
date:		Sat Apr 02 12:36:58 2011 +0200

Fix focussing of messages:

* Don't apply regainedFocus in 1to1 chats.
* Unset lastFocus when the focus is removed, not only when a new unfocussed message arrives.

diffs (34 lines):

diff -r 67a59959597d -r 742a577f459c Plugins/WebKit Message View/AIWebKitMessageViewController.m
--- a/Plugins/WebKit Message View/AIWebKitMessageViewController.m	Fri Apr 01 14:26:19 2011 +0200
+++ b/Plugins/WebKit Message View/AIWebKitMessageViewController.m	Sat Apr 02 12:36:58 2011 +0200
@@ -718,6 +718,7 @@
 				[content addDisplayClass:@"focus"];
 				[content addDisplayClass:@"lastFocus"];
 				
+				// if there's something else already lastFocus, then unset it
 				DOMNodeList *nodeList = [webView.mainFrameDocument querySelectorAll:@".lastFocus"];
 				DOMHTMLElement *node = nil; NSMutableArray *classes = nil;
 				for (unsigned i = 0; i < nodeList.length; i++)
@@ -734,7 +735,13 @@
 			}
 		}
 		
-		if (content.postProcessContent && adium.interfaceController.activeChat == content.chat && !nextMessageFocus && nextMessageRegainedFocus) {
+		/* Only if the message is a group chat message that should be postprocessed, and it's in the active chat
+		 * with something already focussed (!nextMessageFocus) and nothing already regainedFocussed
+		 * (nextMessageRegainedFocus), _then_ this message will be regainedFocus.
+		 */
+		if (content.postProcessContent && content.chat.isGroupChat && adium.interfaceController.activeChat == content.chat
+			&& !nextMessageFocus && nextMessageRegainedFocus) {
+			
 			nextMessageRegainedFocus = NO;
 			[content addDisplayClass:@"regainedFocus"];
 		}
@@ -1533,6 +1540,7 @@
 		
 		[classes removeObject:@"focus"];
 		[classes removeObject:@"firstFocus"];
+		[classes removeObject:@"lastFocus"];
 		
 		node.className = [classes componentsJoinedByString:@" "];
 		




More information about the commits mailing list