adium 4045:3b5258c112b8: When a subcontact of a metacontact is t...
commits at adium.im
commits at adium.im
Mon Jul 11 13:55:52 UTC 2011
details: http://hg.adium.im/adium/rev/3b5258c112b8
revision: 4045:3b5258c112b8
branch: (none)
author: Thijs Alkemade <thijsalkemade at gmail.com>
date: Mon Jul 11 15:49:07 2011 +0200
When a subcontact of a metacontact is typing or has unviewed content, apply the status coloring to the metacontact as well, so the metacontact gets highlighted even if this subcontact is not the prefered contact.
Fixes #14493
(transplanted from 8edc9f32d9ff30613edc7f42f9376c012d29fd1e)
diffs (67 lines):
diff -r 48c89bf9a350 -r 3b5258c112b8 Frameworks/Adium Framework/Source/AIListContactCell.m
--- a/Frameworks/Adium Framework/Source/AIListContactCell.m Mon Jul 11 10:25:11 2011 +0200
+++ b/Frameworks/Adium Framework/Source/AIListContactCell.m Mon Jul 11 15:49:07 2011 +0200
@@ -669,9 +669,6 @@
- (NSColor *)textColor
{
NSColor *theTextColor;
- //BOOL isEvent = [listObject boolValueForProperty:@"isEvent"];
- /* XXX If it's an event, we may want to be inheriting from more than just the metacontact's preferred contact...
- * this is the only case for that which I've come across */
if (shouldUseContactTextColors && (theTextColor = [listObject valueForProperty:@"textColor"])) {
return theTextColor;
} else {
diff -r 48c89bf9a350 -r 3b5258c112b8 Source/AIContactStatusColoringPlugin.m
--- a/Source/AIContactStatusColoringPlugin.m Mon Jul 11 10:25:11 2011 +0200
+++ b/Source/AIContactStatusColoringPlugin.m Mon Jul 11 15:49:07 2011 +0200
@@ -146,6 +146,8 @@
NSInteger unviewedContent;
CGFloat opacity = FULL_IMAGE_OPACITY;
BOOL isEvent = NO;
+ // Only in the case the other contact is typing or has unread contact should we apply it to the meta contact as well
+ BOOL applyToMetaToo = NO;
//Prefetch the value for unviewed content, we need it multiple times below
unviewedContent = [inContact integerValueForProperty:KEY_UNVIEWED_CONTENT];
@@ -160,6 +162,7 @@
invertedColor = unviewedContentInvertedColor;
labelColor = unviewedContentLabelColor;
isEvent = YES;
+ applyToMetaToo = YES;
}
}
@@ -189,7 +192,7 @@
invertedColor = typingInvertedColor;
labelColor = typingLabelColor;
isEvent = YES;
-
+ applyToMetaToo = YES;
}
}
@@ -241,6 +244,24 @@
[inContact setValue:[NSNumber numberWithBool:isEvent]
forProperty:@"isEvent"
notify:NotifyNever];
+
+ if (applyToMetaToo && [inContact metaContact]) {
+ [[inContact metaContact] setValue:color
+ forProperty:@"textColor"
+ notify:NotifyNever];
+ [[inContact metaContact] setValue:invertedColor
+ forProperty:@"invertedTextColor"
+ notify:NotifyNever];
+ [[inContact metaContact] setValue:labelColor
+ forProperty:@"labelColor"
+ notify:NotifyNever];
+ [[inContact metaContact] setValue:[NSNumber numberWithDouble:opacity]
+ forProperty:@"imageOpacity"
+ notify:NotifyNever];
+ [[inContact metaContact] setValue:[NSNumber numberWithBool:isEvent]
+ forProperty:@"isEvent"
+ notify:NotifyNever];
+ }
}
//Flash all handles with unviewed content
More information about the commits
mailing list