adium 5460:231fb0c720ae: Merged adium-1.6 into default.
commits at adium.im
commits at adium.im
Thu May 2 22:06:58 UTC 2013
details: http://hg.adium.im/adium/rev/231fb0c720ae
revision: 5460:231fb0c720ae
branch: (none)
author: Thijs Alkemade <me at thijsalkema.de>
date: Fri May 03 00:06:06 2013 +0200
Merged adium-1.6 into default.
diffs (truncated from 2478 to 1000 lines):
diff -r 38474a401742 -r 231fb0c720ae Frameworks/AIUtilities Framework/Source/AIColorAdditions.m
--- a/Frameworks/AIUtilities Framework/Source/AIColorAdditions.m Fri Apr 26 18:36:46 2013 +0200
+++ b/Frameworks/AIUtilities Framework/Source/AIColorAdditions.m Fri May 03 00:06:06 2013 +0200
@@ -163,6 +163,7 @@
[NSColor colorWithHTMLString:@"#00f"], @"blue",
[NSColor colorWithHTMLString:@"#008080"], @"teal",
[NSColor colorWithHTMLString:@"#0ff"], @"aqua",
+ [NSColor colorWithHTMLString:@"#4b0082"], @"indigo",
nil];
NSArray *paths = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:defaultRGBTxtLocation1 error:NULL];
for (NSString *middlePath in paths) {
@@ -527,7 +528,9 @@
NSDictionary *colorValues = [self colorNamesDictionary];
colorValue = [colorValues objectForKey:str];
if (!colorValue) colorValue = [colorValues objectForKey:[str lowercaseString]];
- if (!colorValue) {
+ if (colorValue) {
+ return colorValue;
+ } else {
#if COLOR_DEBUG
NSLog(@"+[NSColor(AIColorAdditions) colorWithHTMLString:] called with unrecognised color name (str is %@); returning %@", str, defaultColor);
#endif
diff -r 38474a401742 -r 231fb0c720ae Frameworks/AIUtilities Framework/Source/AIImageViewWithImagePicker.m
--- a/Frameworks/AIUtilities Framework/Source/AIImageViewWithImagePicker.m Fri Apr 26 18:36:46 2013 +0200
+++ b/Frameworks/AIUtilities Framework/Source/AIImageViewWithImagePicker.m Fri May 03 00:06:06 2013 +0200
@@ -254,7 +254,7 @@
//Draw our original image as 50% transparent
[dragImage lockFocus];
- [[self image] dissolveToPoint:NSZeroPoint fraction:0.5f];
+ [[self image] drawAtPoint:NSZeroPoint fromRect:NSMakeRect(0, 0, self.image.size.width, self.image.size.height) operation:NSCompositeCopy fraction:0.5f];
[dragImage unlockFocus];
//We want the image to resize
diff -r 38474a401742 -r 231fb0c720ae Frameworks/Adium Framework/Source/AIAbstractListController.m
--- a/Frameworks/Adium Framework/Source/AIAbstractListController.m Fri Apr 26 18:36:46 2013 +0200
+++ b/Frameworks/Adium Framework/Source/AIAbstractListController.m Fri May 03 00:06:06 2013 +0200
@@ -28,6 +28,7 @@
#import <Adium/AIListObject.h>
#import <Adium/AIListContact.h>
#import <Adium/AIListGroup.h>
+#import <Adium/AIGroupChat.h>
#import <Adium/AIMetaContact.h>
#import <Adium/AIListOutlineView.h>
#import <Adium/AIMenuControllerProtocol.h>
@@ -590,11 +591,20 @@
id<AIContainingObject> listObject = (id<AIContainingObject>)(item.listObject);
proxyListObject = [AIProxyListObject proxyListObjectForListObject:[listObject visibleObjectAtIndex:idx]
inListObject:listObject];
-
- } else if (hideRoot)
- proxyListObject = [AIProxyListObject proxyListObjectForListObject:[contactList visibleObjectAtIndex:idx]
- inListObject:contactList];
- else
+
+ } else if (hideRoot) {
+ if ([contactList isKindOfClass:[AIGroupChat class]]) {
+ NSString *nick = [(AIGroupChat *)contactList visibleObjectAtIndex:idx];
+ AIListObject *listObject = [(AIGroupChat *)contactList contactForNick:nick];
+
+ proxyListObject = [AIProxyListObject proxyListObjectForListObject:listObject
+ inListObject:contactList
+ withNick:nick];
+ } else {
+ proxyListObject = [AIProxyListObject proxyListObjectForListObject:[contactList visibleObjectAtIndex:idx]
+ inListObject:contactList];
+ }
+ } else
proxyListObject = [AIProxyListObject proxyListObjectForListObject:contactList
inListObject:nil];
diff -r 38474a401742 -r 231fb0c720ae Frameworks/Adium Framework/Source/AIChat.m
--- a/Frameworks/Adium Framework/Source/AIChat.m Fri Apr 26 18:36:46 2013 +0200
+++ b/Frameworks/Adium Framework/Source/AIChat.m Fri May 03 00:06:06 2013 +0200
@@ -606,6 +606,7 @@
AIContentMessage *messageContent;
messageContent = [AIContentMessage messageInChat:self
withSource:self.account
+ sourceNick:nil
destination:self.listObject
date:nil
message:attributedMessage
diff -r 38474a401742 -r 231fb0c720ae Frameworks/Adium Framework/Source/AIContentMessage.h
--- a/Frameworks/Adium Framework/Source/AIContentMessage.h Fri Apr 26 18:36:46 2013 +0200
+++ b/Frameworks/Adium Framework/Source/AIContentMessage.h Fri May 03 00:06:06 2013 +0200
@@ -45,7 +45,15 @@
withSource:(id)inSource
destination:(id)inDest
date:(NSDate *)inDate
- message:(NSAttributedString *)inMessage
+ message:(NSAttributedString *)inMessage
+ autoreply:(BOOL)inAutoReply;
+
++ (id)messageInChat:(AIChat *)inChat
+ withSource:(id)inSource
+ sourceNick:(NSString *)inSourceNick
+ destination:(id)inDest
+ date:(NSDate *)inDate
+ message:(NSAttributedString *)inMessage
autoreply:(BOOL)inAutoreply;
/*! @brief Create an AIContentMessage.
@@ -56,6 +64,7 @@
*/
- (id)initWithChat:(AIChat *)inChat
source:(id)inSource
+ sourceNick:(NSString *)inSourceNick
destination:(id)inDest
date:(NSDate *)inDate
message:(NSAttributedString *)inMessage
diff -r 38474a401742 -r 231fb0c720ae Frameworks/Adium Framework/Source/AIContentMessage.m
--- a/Frameworks/Adium Framework/Source/AIContentMessage.m Fri Apr 26 18:36:46 2013 +0200
+++ b/Frameworks/Adium Framework/Source/AIContentMessage.m Fri May 03 00:06:06 2013 +0200
@@ -21,7 +21,6 @@
@implementation AIContentMessage
-//Create a content message
+ (id)messageInChat:(AIChat *)inChat
withSource:(id)inSource
destination:(id)inDest
@@ -30,11 +29,30 @@
autoreply:(BOOL)inAutoReply
{
return [[self alloc] initWithChat:inChat
- source:inSource
- destination:inDest
- date:inDate
- message:inMessage
- autoreply:inAutoReply];
+ source:inSource
+ sourceNick:nil
+ destination:inDest
+ date:inDate
+ message:inMessage
+ autoreply:inAutoReply];
+}
+
+//Create a content message
++ (id)messageInChat:(AIChat *)inChat
+ withSource:(id)inSource
+ sourceNick:(NSString *)inSourceNick
+ destination:(id)inDest
+ date:(NSDate *)inDate
+ message:(NSAttributedString *)inMessage
+ autoreply:(BOOL)inAutoReply
+{
+ return [[self alloc] initWithChat:inChat
+ source:inSource
+ sourceNick:inSourceNick
+ destination:inDest
+ date:inDate
+ message:inMessage
+ autoreply:inAutoReply];
}
//Content Identifier
@@ -46,12 +64,13 @@
//Init
- (id)initWithChat:(AIChat *)inChat
source:(id)inSource
+ sourceNick:(NSString *)inSourceNick
destination:(id)inDest
date:(NSDate *)inDate
message:(NSAttributedString *)inMessage
autoreply:(BOOL)inAutoReply
{
- if ((self = [super initWithChat:inChat source:inSource destination:inDest date:inDate message:inMessage])) {
+ if ((self = [super initWithChat:inChat source:inSource sourceNick:inSourceNick destination:inDest date:inDate message:inMessage])) {
isAutoreply = inAutoReply;
encodedMessage = nil;
encodedMessageAccountData = nil;
@@ -66,7 +85,7 @@
[classes addObject:@"message"];
if(isAutoreply) [classes addObject:@"autoreply"];
if(self.chat.isGroupChat) {
- AIGroupChatFlags flags = [(AIGroupChat *)self.chat flagsForContact:(AIListContact *)self.source];
+ AIGroupChatFlags flags = [(AIGroupChat *)self.chat flagsForNick:self.sourceNick];
if (flags & AIGroupChatOp)
[classes addObject:@"op"];
if (flags & AIGroupChatHalfOp)
@@ -83,7 +102,7 @@
{
if (!self.chat.isGroupChat) return @"";
- AIGroupChatFlags flags = [(AIGroupChat *)self.chat flagsForContact:(AIListContact *)self.source];
+ AIGroupChatFlags flags = [(AIGroupChat *)self.chat flagsForNick:self.sourceNick];
if ((flags & AIGroupChatFounder) == AIGroupChatFounder) {
return @"~";
diff -r 38474a401742 -r 231fb0c720ae Frameworks/Adium Framework/Source/AIContentObject.h
--- a/Frameworks/Adium Framework/Source/AIContentObject.h Fri Apr 26 18:36:46 2013 +0200
+++ b/Frameworks/Adium Framework/Source/AIContentObject.h Fri May 03 00:06:06 2013 +0200
@@ -38,6 +38,7 @@
AIChat *__weak chat;
AIListObject *source;
AIListObject *destination;
+ NSString *sourceNick;
BOOL outgoing;
NSAttributedString *message;
@@ -86,6 +87,13 @@
date:(NSDate*)inDate
message:(NSAttributedString *)inMessage;
+- (id)initWithChat:(AIChat *)inChat
+ source:(AIListObject *)inSource
+ sourceNick:(NSString *)inSourceNick
+ destination:(AIListObject *)inDest
+ date:(NSDate*)inDate
+ message:(NSAttributedString *)inMessage;
+
/*! @brief The type of content.
*
* @par There is at least one type defined for every concrete subclass of \c AIContentObject.
@@ -254,4 +262,6 @@
*/
@property (nonatomic) BOOL postProcessContent;
+ at property (nonatomic, retain) NSString *sourceNick;
+
@end
diff -r 38474a401742 -r 231fb0c720ae Frameworks/Adium Framework/Source/AIContentObject.m
--- a/Frameworks/Adium Framework/Source/AIContentObject.m Fri Apr 26 18:36:46 2013 +0200
+++ b/Frameworks/Adium Framework/Source/AIContentObject.m Fri May 03 00:06:06 2013 +0200
@@ -22,7 +22,7 @@
@implementation AIContentObject
@synthesize source, destination, date, isOutgoing = outgoing, chat, message, userInfo;
- at synthesize filterContent, trackContent, displayContent, displayContentImmediately, sendContent, postProcessContent;
+ at synthesize filterContent, trackContent, displayContent, displayContentImmediately, sendContent, postProcessContent, sourceNick;
- (id)initWithChat:(AIChat *)inChat
source:(AIListObject *)inSource
@@ -31,12 +31,23 @@
{
return [self initWithChat:inChat source:inSource destination:inDest date:inDate message:nil];
}
+
- (id)initWithChat:(AIChat *)inChat
source:(AIListObject *)inSource
destination:(AIListObject *)inDest
date:(NSDate*)inDate
message:(NSAttributedString *)inMessage
{
+ return [self initWithChat:inChat source:inSource sourceNick:nil destination:inDest date:inDate message:inMessage];
+}
+
+- (id)initWithChat:(AIChat *)inChat
+ source:(AIListObject *)inSource
+ sourceNick:(NSString *)inSourceNick
+ destination:(AIListObject *)inDest
+ date:(NSDate*)inDate
+ message:(NSAttributedString *)inMessage
+{
if ((self = [super init]))
{
//Default Behavior
@@ -49,6 +60,7 @@
//Store source, dest, chat, ...
source = inSource;
+ sourceNick = inSourceNick;
destination = inDest;
message = inMessage;
date = (inDate ? inDate : [NSDate date]);
diff -r 38474a401742 -r 231fb0c720ae Frameworks/Adium Framework/Source/AIContentTopic.h
--- a/Frameworks/Adium Framework/Source/AIContentTopic.h Fri Apr 26 18:36:46 2013 +0200
+++ b/Frameworks/Adium Framework/Source/AIContentTopic.h Fri May 03 00:06:06 2013 +0200
@@ -27,8 +27,9 @@
+ (id)topicInChat:(AIChat *)inChat
withSource:(id)inSource
+ sourceNick:(NSString *)inSourceNick
destination:(id)inDest
- date:(NSDate *)inDate
+ date:(NSDate *)inDate
message:(NSAttributedString *)inMessage;
@property (nonatomic) BOOL actuallyBlank;
diff -r 38474a401742 -r 231fb0c720ae Frameworks/Adium Framework/Source/AIContentTopic.m
--- a/Frameworks/Adium Framework/Source/AIContentTopic.m Fri Apr 26 18:36:46 2013 +0200
+++ b/Frameworks/Adium Framework/Source/AIContentTopic.m Fri May 03 00:06:06 2013 +0200
@@ -20,12 +20,14 @@
@implementation AIContentTopic
+ (id)topicInChat:(AIChat *)inChat
withSource:(id)inSource
+ sourceNick:(NSString *)inSourceNick
destination:(id)inDest
date:(NSDate *)inDate
message:(NSAttributedString *)inMessage
{
return [super messageInChat:inChat
withSource:inSource
+ sourceNick:inSourceNick
destination:inDest
date:inDate
message:inMessage
diff -r 38474a401742 -r 231fb0c720ae Frameworks/Adium Framework/Source/AIGroupChat.h
--- a/Frameworks/Adium Framework/Source/AIGroupChat.h Fri Apr 26 18:36:46 2013 +0200
+++ b/Frameworks/Adium Framework/Source/AIGroupChat.h Fri May 03 00:06:06 2013 +0200
@@ -18,10 +18,11 @@
@interface AIGroupChat : AIChat <AIContainingObject> {
NSString *topic;
-
- NSMutableDictionary *participatingContactsFlags;
- NSMutableDictionary *participatingContactsAliases;
- NSMutableArray *participatingContacts;
+ NSString *topicSetter;
+
+ NSMutableDictionary *participatingNicksFlags;
+ NSMutableDictionary *participatingNicksContacts;
+ NSMutableArray *participatingNicks;
BOOL showJoinLeave;
BOOL expanded;
@@ -33,26 +34,29 @@
@property (readonly, nonatomic) BOOL supportsTopic;
-- (void)updateTopic:(NSString *)inTopic withSource:(AIListContact *)contact;
+- (void)updateTopic:(NSString *)inTopic withSource:(NSString *)contact;
- (void)setTopic:(NSString *)inTopic;
@property (readwrite, copy, nonatomic) NSDate *lastMessageDate;
// Group chat participants.
-- (NSString *)displayNameForContact:(AIListObject *)contact;
-- (AIGroupChatFlags)flagsForContact:(AIListObject *)contact;
-- (NSString *)aliasForContact:(AIListObject *)contact;
-- (void)setFlags:(AIGroupChatFlags)flags forContact:(AIListObject *)contact;
-- (void)setAlias:(NSString *)alias forContact:(AIListObject *)contact;
-- (void)removeSavedValuesForContactUID:(NSString *)contactUID;
+- (AIListContact *)contactForNick:(NSString *)nick;
+- (AIGroupChatFlags)flagsForNick:(NSString *)nick;
+- (void)setFlags:(AIGroupChatFlags)flags forNick:(NSString *)nick;
+- (void)setContact:(AIListContact *)contact forNick:(NSString *)nick;
+- (void)changeNick:(NSString *)from to:(NSString *)to;
+- (void)removeSavedValuesForNick:(NSString *)nick;
+- (NSArray *)nicksForContact:(AIListObject *)contact;
-- (void)addParticipatingListObject:(AIListContact *)inObject notify:(BOOL)notify;
-- (void)addParticipatingListObjects:(NSArray *)inObjects notify:(BOOL)notify;
+- (void)addParticipatingNick:(NSString *)inObject notify:(BOOL)notify;
+- (void)addParticipatingNicks:(NSArray *)inObjects notify:(BOOL)notify;
- (void)removeAllParticipatingContactsSilently;
-- (void)removeObject:(AIListObject *)inObject;
+- (void)removeObject:(NSString *)inObject;
- (BOOL)inviteListContact:(AIListContact *)inObject withMessage:(NSString *)inviteMessage;
- (void)resortParticipants;
+- (NSString *)visibleObjectAtIndex:(NSUInteger)idx;
+
@end
diff -r 38474a401742 -r 231fb0c720ae Frameworks/Adium Framework/Source/AIGroupChat.m
--- a/Frameworks/Adium Framework/Source/AIGroupChat.m Fri Apr 26 18:36:46 2013 +0200
+++ b/Frameworks/Adium Framework/Source/AIGroupChat.m Fri May 03 00:06:06 2013 +0200
@@ -31,7 +31,6 @@
@interface AIGroupChat ()
- (void)contentObjectAdded:(NSNotification *)notification;
-- (AIListContact *)visibleObjectAtIndex:(NSUInteger)idx;
@end
@@ -46,9 +45,9 @@
if ((self = [super initForAccount:inAccount])) {
showJoinLeave = YES;
expanded = YES;
- participatingContacts = [[NSMutableArray alloc] init];
- participatingContactsFlags = [[NSMutableDictionary alloc] init];
- participatingContactsAliases = [[NSMutableDictionary alloc] init];
+ participatingNicks = [[NSMutableArray alloc] init];
+ participatingNicksFlags = [[NSMutableDictionary alloc] init];
+ participatingNicksContacts = [[NSMutableDictionary alloc] init];
[[NSNotificationCenter defaultCenter] addObserver:self
@@ -117,20 +116,6 @@
[super object:inObject didChangeValueForProperty:key notify:notify];
}
-/*!
- * @brief The alias for a given contact
- */
-- (NSString *)aliasForContact:(AIListObject *)contact
-{
- NSString *alias = [participatingContactsAliases objectForKey:contact.UID];
-
- if (!alias) {
- alias = [self.account fallbackAliasForContact:(AIListContact *)contact inChat:self];
- }
-
- return alias;
-}
-
AIGroupChatFlags highestFlag(AIGroupChatFlags flags)
{
if ((flags & AIGroupChatFounder) == AIGroupChatFounder)
@@ -194,15 +179,18 @@
/*!
* @brief Update the topic.
*/
-- (void)updateTopic:(NSString *)inTopic withSource:(AIListContact *)contact
+- (void)updateTopic:(NSString *)inTopic withSource:(NSString *)nick
{
+ AIListContact *contact = [self contactForNick:nick];
+
[self setValue:inTopic forProperty:KEY_TOPIC notify:NotifyNow];
- [self setValue:contact forProperty:KEY_TOPIC_SETTER notify:NotifyNow];
+ [self setValue:nick forProperty:KEY_TOPIC_SETTER notify:NotifyNow];
// Apply the new topic to the message view
AIContentTopic *contentTopic = [AIContentTopic topicInChat:self
withSource:contact
+ sourceNick:nick
destination:nil
date:[NSDate date]
message:[NSAttributedString stringWithString:[self valueForProperty:KEY_TOPIC] ?: @""]];
@@ -250,15 +238,15 @@
*/
- (void)resortParticipants
{
- [participatingContacts sortUsingComparator:^(id objectA, id objectB){
- AIGroupChatFlags flagA = highestFlag([self flagsForContact:objectA]), flagB = highestFlag([self flagsForContact:objectB]);
+ [participatingNicks sortUsingComparator:^(id objectA, id objectB){
+ AIGroupChatFlags flagA = highestFlag([self flagsForNick:objectA]), flagB = highestFlag([self flagsForNick:objectB]);
if(flagA > flagB) {
return (NSComparisonResult)NSOrderedAscending;
} else if (flagA < flagB) {
return (NSComparisonResult)NSOrderedDescending;
} else {
- return [[self displayNameForContact:objectA] localizedCaseInsensitiveCompare:[self displayNameForContact:objectB]];
+ return [objectA localizedCaseInsensitiveCompare:objectB];
}
}];
}
@@ -266,46 +254,42 @@
//Participating ListObjects --------------------------------------------------------------------------------------------
#pragma mark Participating ListObjects
-/*!
- * @brief The display name for the contact in this chat.
- *
- * @param contact The AIListObject whose display name should be created
- *
- * If the user has an alias set, the alias is used, otherwise the display name.
- *
- * @returns Display name
- */
-- (NSString *)displayNameForContact:(AIListObject *)contact
+- (AIListObject *)contactForNick:(NSString *)nick
{
- return [self aliasForContact:contact] ?: contact.displayName;
+ return [participatingNicksContacts objectForKey:nick];
}
-/*!
- * @brief The flags for a given contact.
- */
-- (AIGroupChatFlags)flagsForContact:(AIListObject *)contact
+- (AIGroupChatFlags)flagsForNick:(NSString *)nick
{
- return [(NSNumber *)[participatingContactsFlags objectForKey:contact.UID] intValue];
+ return [[participatingNicksFlags objectForKey:nick] intValue];
}
-/*!
- * @brief Set the flags for a contact
- *
- * Note that this doesn't set the bitwise or; this directly sets the value passed.
- */
-- (void)setFlags:(AIGroupChatFlags)flags forContact:(AIListObject *)contact
+- (void)setFlags:(AIGroupChatFlags)flags forNick:(NSString *)nick
{
- [participatingContactsFlags setObject:[NSNumber numberWithInteger:flags]
- forKey:contact.UID];
+ [participatingNicksFlags setObject:@(flags)
+ forKey:nick];
}
-/*!
- * @brief Set the alias for a contact.
- */
-- (void)setAlias:(NSString *)alias forContact:(AIListObject *)contact
+- (void)setContact:(AIListContact *)contact forNick:(NSString *)nick
{
- [participatingContactsAliases setObject:alias
- forKey:contact.UID];
+ NSParameterAssert(contact != nil);
+
+ [participatingNicksContacts setObject:contact
+ forKey:nick];
+}
+
+- (void)changeNick:(NSString *)from to:(NSString *)to
+{
+ [participatingNicks removeObject:from];
+ [participatingNicks addObject:to];
+
+ NSNumber *flags = [participatingNicksFlags objectForKey:from];
+ [participatingNicksFlags removeObjectForKey:from];
+ if (flags) [participatingNicksFlags setObject:flags forKey:to];
+
+ AIListObject *contact = [participatingNicksContacts objectForKey:from];
+ [participatingNicksContacts removeObjectForKey:from];
+ if (contact) [participatingNicksContacts setObject:contact forKey:to];
}
/*!
@@ -314,35 +298,41 @@
* Removes any values which are dependent upon the contact, such as
* its flags or alias.
*/
-- (void)removeSavedValuesForContactUID:(NSString *)contactUID
+- (void)removeSavedValuesForNick:(NSString *)nick
{
- [participatingContactsFlags removeObjectForKey:contactUID];
- [participatingContactsAliases removeObjectForKey:contactUID];
+ [participatingNicksFlags removeObjectForKey:nick];
+ [participatingNicksContacts removeObjectForKey:nick];
}
-- (void)addParticipatingListObject:(AIListContact *)inObject notify:(BOOL)notify
+- (NSArray *)nicksForContact:(AIListObject *)contact
{
- [self addParticipatingListObjects:[NSArray arrayWithObject:inObject] notify:notify];
+ NSMutableArray *nicks = [NSMutableArray array];
+
+ for (NSString *nick in participatingNicks) {
+ if ([[participatingNicksContacts objectForKey:nick] isEqual:contact]) {
+ [nicks addObject:nick];
+ }
+ }
+
+ return nicks;
}
-- (void)addParticipatingListObjects:(NSArray *)inObjects notify:(BOOL)notify
+- (void)addParticipatingNick:(NSString *)inObject notify:(BOOL)notify
{
- NSMutableArray *contacts = [inObjects mutableCopy];
-
- for (AIListObject *obj in inObjects) {
- if ([self containsObject:obj] || ![self canContainObject:obj])
- [contacts removeObject:obj];
- }
-
- [participatingContacts addObjectsFromArray:contacts];
- [adium.chatController chat:self addedListContacts:contacts notify:notify];
+ [self addParticipatingNicks:[NSArray arrayWithObject:inObject] notify:notify];
}
-- (BOOL)addObject:(AIListObject *)inObject
+- (void)addParticipatingNicks:(NSArray *)inObjects notify:(BOOL)notify
{
- NSParameterAssert([inObject isKindOfClass:[AIListContact class]]);
+ [participatingNicks addObjectsFromArray:inObjects];
+ [adium.chatController chat:self addedListContacts:inObjects notify:notify];
+}
+
+- (BOOL)addObject:(NSString *)inObject
+{
+ NSParameterAssert([inObject isKindOfClass:[NSString class]]);
- [self addParticipatingListObject:(AIListContact *)inObject notify:YES];
+ [self addParticipatingNick:inObject notify:YES];
return YES;
}
@@ -352,84 +342,97 @@
return ([self.account inviteContact:inContact toChat:self withMessage:inviteMessage]);
}
-#pragma mark AIContainingObject protocol
+- (NSArray *)containedObjects
+{
+ return [participatingNicksContacts allValues];
+}
+
- (NSArray *)visibleContainedObjects
{
return self.containedObjects;
}
-- (NSArray *)containedObjects
-{
- return participatingContacts;
-}
+
- (NSUInteger)countOfContainedObjects
{
- return [participatingContacts count];
+ return [participatingNicks count];
}
- (BOOL)containsObject:(AIListObject *)inObject
{
- return [participatingContacts containsObjectIdenticalTo:inObject];
+ return [[participatingNicksContacts allValues] containsObjectIdenticalTo:inObject];
}
-- (AIListContact *)visibleObjectAtIndex:(NSUInteger)idx
+- (NSString *)visibleObjectAtIndex:(NSUInteger)idx
{
- return [participatingContacts objectAtIndex:idx];
+ return [participatingNicks objectAtIndex:idx];
}
- (NSUInteger)visibleIndexOfObject:(AIListObject *)obj
{
if(![[AIContactHidingController sharedController] visibilityOfListObject:obj inContainer:self])
return NSNotFound;
- return [participatingContacts indexOfObject:obj];
+ for (NSString *nick in participatingNicks) {
+ if ([[participatingNicksContacts objectForKey:nick] isEqual:obj]) {
+ return [participatingNicks indexOfObject:nick];
+ }
+ }
+
+ return NSNotFound;
}
- (NSArray *)uniqueContainedObjects
{
- return self.containedObjects;
+ NSMutableArray *contacts = [NSMutableArray array];
+
+ for (AIListContact *contact in [participatingNicksContacts allValues]) {
+ if (![contacts containsObject:contacts]) {
+ [contacts addObject:contact];
+ }
+ }
+
+ return contacts;
}
-- (void)removeObject:(AIListObject *)inObject
+- (void)removeObject:(NSString *)inObject
{
- if ([self containsObject:inObject]) {
- AIListContact *contact = (AIListContact *)inObject; //if we contain it, it has to be an AIListContact
+ AIListContact *contact = [participatingNicksContacts valueForKey:inObject];
+
+ [participatingNicks removeObject:inObject];
+
+ [self removeSavedValuesForNick:inObject];
+
+ [adium.chatController chat:self removedListContact:contact];
+
+ if (contact.isStranger &&
+ ![adium.chatController allGroupChatsContainingContact:contact.parentContact].count &&
+ ![adium.chatController existingChatWithContact:contact.parentContact]) {
- [participatingContacts removeObject:inObject];
-
- [self removeSavedValuesForContactUID:inObject.UID];
-
- [adium.chatController chat:self removedListContact:contact];
-
- if (contact.isStranger &&
- ![adium.chatController allGroupChatsContainingContact:contact.parentContact].count &&
- ![adium.chatController existingChatWithContact:contact.parentContact]) {
-
- [[AIContactObserverManager sharedManager] delayListObjectNotifications];
- [adium.contactController accountDidStopTrackingContact:contact];
- [[AIContactObserverManager sharedManager] endListObjectNotificationsDelaysImmediately];
- }
+ [[AIContactObserverManager sharedManager] delayListObjectNotifications];
+ [adium.contactController accountDidStopTrackingContact:contact];
+ [[AIContactObserverManager sharedManager] endListObjectNotificationsDelaysImmediately];
}
}
-- (void)removeObjectAfterAccountStopsTracking:(AIListObject *)object
+- (void)removeObjectAfterAccountStopsTracking:(NSString *)object
{
- [self removeObject:object]; //does nothing if we've already removed it
+ [self removeObject:object];
}
- (void)removeAllParticipatingContactsSilently
{
/* Note that allGroupChatsContainingContact won't count this chat if it's already marked as not open */
- for (AIListContact *listContact in self) {
+ for (AIListContact *listContact in [participatingNicksContacts allValues]) {
if (listContact.isStranger &&
![adium.chatController existingChatWithContact:listContact.parentContact] &&
([adium.chatController allGroupChatsContainingContact:listContact.parentContact].count == 0)) {
[adium.contactController accountDidStopTrackingContact:listContact];
}
}
-
- [participatingContacts removeAllObjects];
- [participatingContactsFlags removeAllObjects];
- [participatingContactsAliases removeAllObjects];
-
+
+ [participatingNicks removeAllObjects];
+ [participatingNicksFlags removeAllObjects];
+ [participatingNicksContacts removeAllObjects];
+
[[NSNotificationCenter defaultCenter] postNotificationName:Chat_ParticipatingListObjectsChanged
object:self];
}
@@ -448,7 +451,7 @@
- (NSUInteger)countByEnumeratingWithState:(NSFastEnumerationState *)state objects:(__unsafe_unretained id [])stackbuf count:(NSUInteger)len
{
- return [participatingContacts countByEnumeratingWithState:state objects:stackbuf count:len];
+ return [participatingNicks countByEnumeratingWithState:state objects:stackbuf count:len];
}
- (BOOL) canContainObject:(id)obj
diff -r 38474a401742 -r 231fb0c720ae Frameworks/Adium Framework/Source/AIListContactGroupChatCell.m
--- a/Frameworks/Adium Framework/Source/AIListContactGroupChatCell.m Fri Apr 26 18:36:46 2013 +0200
+++ b/Frameworks/Adium Framework/Source/AIListContactGroupChatCell.m Fri May 03 00:06:06 2013 +0200
@@ -25,11 +25,10 @@
- (NSString *)labelString
{
- AIListObject *listObject = [proxyObject listObject];
NSString *label;
- if (chat && [chat displayNameForContact:listObject]) {
- label = [chat displayNameForContact:listObject];
+ if (proxyObject.nick) {
+ label = proxyObject.nick;
} else {
label = [super labelString];
}
@@ -39,23 +38,21 @@
- (NSImage *)statusImage
{
- AIListObject *listObject = [proxyObject listObject];
- return [[AIGroupChatStatusIcons sharedIcons] imageForFlag:[chat flagsForContact:listObject]];
+ return [[AIGroupChatStatusIcons sharedIcons] imageForFlag:[chat flagsForNick:proxyObject.nick]];
}
- (NSImage *)serviceImage
{
// We can't use [listObject statusIcon] because it will show unknown for strangers.
- AIListObject *listObject = [proxyObject listObject];
- return [AIStatusIcons statusIconForListObject:listObject
+ AIListContact *listObject = [chat contactForNick:proxyObject.nick];
+ return [AIStatusIcons statusIconForListObject:(AIListObject *)listObject
type:AIStatusIconTab
direction:AIIconFlipped];
}
- (NSColor *)textColor
{
- AIListObject *listObject = [proxyObject listObject];
- return [[AIGroupChatStatusIcons sharedIcons] colorForFlag:[chat flagsForContact:listObject]];
+ return [[AIGroupChatStatusIcons sharedIcons] colorForFlag:[chat flagsForNick:proxyObject.nick]];
}
- (float)imageOpacityForDrawing
diff -r 38474a401742 -r 231fb0c720ae Frameworks/Adium Framework/Source/AIProxyListObject.h
--- a/Frameworks/Adium Framework/Source/AIProxyListObject.h Fri Apr 26 18:36:46 2013 +0200
+++ b/Frameworks/Adium Framework/Source/AIProxyListObject.h Fri May 03 00:06:06 2013 +0200
@@ -25,6 +25,7 @@
NSAttributedString *cachedDisplayName;
NSDictionary *cachedLabelAttributes;
NSSize cachedDisplayNameSize;
+ NSString *nick;
}
@property (nonatomic, copy) NSDictionary *cachedLabelAttributes;
@property (nonatomic, strong) NSString *cachedDisplayNameString;
@@ -32,6 +33,7 @@
@property (nonatomic) NSSize cachedDisplayNameSize;
@property (nonatomic, strong) NSString *key;
+ at property (nonatomic, strong) NSString *nick;
@property (nonatomic, weak) AIListObject *listObject;
@property (nonatomic, weak) ESObjectWithProperties <AIContainingObject> * containingObject;
@@ -42,6 +44,10 @@
+ (AIProxyListObject *)existingProxyListObjectForListObject:(ESObjectWithProperties *)inListObject
inListObject:(ESObjectWithProperties <AIContainingObject>*)inContainingObject;
++ (AIProxyListObject *)proxyListObjectForListObject:(AIListObject *)inListObject
+ inListObject:(ESObjectWithProperties <AIContainingObject>*)inContainingObject
+ withNick:(NSString *)inNick;
+
/*!
* @brief Called when an AIListObject is done with an AIProxyListObject to remove it from the global dictionary
*/
diff -r 38474a401742 -r 231fb0c720ae Frameworks/Adium Framework/Source/AIProxyListObject.m
--- a/Frameworks/Adium Framework/Source/AIProxyListObject.m Fri Apr 26 18:36:46 2013 +0200
+++ b/Frameworks/Adium Framework/Source/AIProxyListObject.m Fri May 03 00:06:06 2013 +0200
@@ -25,7 +25,7 @@
@implementation AIProxyListObject
@synthesize key, cachedDisplayName, cachedDisplayNameString, cachedLabelAttributes, cachedDisplayNameSize;
- at synthesize listObject, containingObject;
+ at synthesize listObject, containingObject, nick;
static inline NSMutableDictionary *_getProxyDict() {
@@ -52,10 +52,21 @@
+ (AIProxyListObject *)proxyListObjectForListObject:(AIListObject *)inListObject
inListObject:(ESObjectWithProperties <AIContainingObject>*)inContainingObject
{
+ return [self proxyListObjectForListObject:inListObject inListObject:inContainingObject withNick:nil];
+}
+
++ (AIProxyListObject *)proxyListObjectForListObject:(AIListObject *)inListObject
+ inListObject:(ESObjectWithProperties <AIContainingObject>*)inContainingObject
+ withNick:(NSString *)inNick
+{
AIProxyListObject *proxy;
NSString *key = (inContainingObject ?
[NSString stringWithFormat:@"%@-%@", inListObject.internalObjectID, inContainingObject.internalObjectID] :
inListObject.internalObjectID);
+
+ if (inNick) {
+ key = [key stringByAppendingFormat:@"-%@", inNick];
+ }
proxy = [proxyDict objectForKey:key];
@@ -73,6 +84,7 @@
proxy.listObject = inListObject;
proxy.containingObject = inContainingObject;
proxy.key = key;
+ proxy.nick = inNick;
[inListObject noteProxyObject:proxy];
[proxyDict setObject:proxy
forKey:key];
diff -r 38474a401742 -r 231fb0c720ae Frameworks/Adium Framework/Source/ESFileTransfer.m
--- a/Frameworks/Adium Framework/Source/ESFileTransfer.m Fri Apr 26 18:36:46 2013 +0200
+++ b/Frameworks/Adium Framework/Source/ESFileTransfer.m Fri May 03 00:06:06 2013 +0200
@@ -70,6 +70,7 @@
}
if ((self = [super initWithChat:aChat
source:s
+ sourceNick:nil
destination:d
date:[NSDate date]
message:[[NSAttributedString alloc] initWithString:@""]
diff -r 38474a401742 -r 231fb0c720ae Frameworks/PSMTabBarControl.framework/Versions/A/Headers/NSBezierPath_AMShading.h
--- a/Frameworks/PSMTabBarControl.framework/Versions/A/Headers/NSBezierPath_AMShading.h Fri Apr 26 18:36:46 2013 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,23 +0,0 @@
-//
-// NSBezierPath_AMShading.h
-// ------------------------
-//
-// Created by Andreas on 2005-06-01.
-// Copyright 2005 Andreas Mayer. All rights reserved.
-//
-// based on http://www.cocoadev.com/index.pl?GradientFill
-
-
-#import <Cocoa/Cocoa.h>
-
- at interface NSBezierPath (AMShading)
-
-- (void)customHorizontalFillWithCallbacks:(CGFunctionCallbacks) functionCallbacks firstColor:(NSColor *)firstColor secondColor:(NSColor *)secondColor;
-- (void)customVerticalFillWithCallbacks:(CGFunctionCallbacks) functionCallbacks firstColor:(NSColor *)firstColor secondColor:(NSColor *)secondColor;
-
-- (void)linearGradientFillWithStartColor:(NSColor *)startColor endColor:(NSColor *)endColor;
-- (void)linearVerticalGradientFillWithStartColor:(NSColor *)startColor endColor:(NSColor *)endColor;
-
-- (void)bilinearGradientFillWithOuterColor:(NSColor *)outerColor innerColor:(NSColor *)innerColor;
-
- at end
diff -r 38474a401742 -r 231fb0c720ae Frameworks/PSMTabBarControl.framework/Versions/A/PSMTabBarControl
Binary file Frameworks/PSMTabBarControl.framework/Versions/A/PSMTabBarControl has changed
diff -r 38474a401742 -r 231fb0c720ae Frameworks/PSMTabBarControl.framework/Versions/A/Resources/English.lproj/InfoPlist.strings
Binary file Frameworks/PSMTabBarControl.framework/Versions/A/Resources/English.lproj/InfoPlist.strings has changed
diff -r 38474a401742 -r 231fb0c720ae Frameworks/PSMTabBarControl.framework/Versions/A/Resources/Info.plist
--- a/Frameworks/PSMTabBarControl.framework/Versions/A/Resources/Info.plist Fri Apr 26 18:36:46 2013 +0200
+++ b/Frameworks/PSMTabBarControl.framework/Versions/A/Resources/Info.plist Fri May 03 00:06:06 2013 +0200
@@ -3,7 +3,7 @@
<plist version="1.0">
<dict>
<key>BuildMachineOSBuild</key>
- <string>12C60</string>
+ <string>12D78</string>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
@@ -23,16 +23,16 @@
<key>DTCompiler</key>
<string>com.apple.compilers.llvm.clang.1_0</string>
<key>DTPlatformBuild</key>
- <string>4H127</string>
+ <string>4H1003</string>
<key>DTPlatformVersion</key>
<string>GM</string>
<key>DTSDKBuild</key>
- <string>12C37</string>
+ <string>12D75</string>
<key>DTSDKName</key>
<string>macosx10.8</string>
<key>DTXcode</key>
- <string>0460</string>
+ <string>0462</string>
<key>DTXcodeBuild</key>
- <string>4H127</string>
+ <string>4H1003</string>
</dict>
</plist>
diff -r 38474a401742 -r 231fb0c720ae Frameworks/PSMTabBarControl.framework/Versions/A/Resources/Japanese.lproj/InfoPlist.strings
Binary file Frameworks/PSMTabBarControl.framework/Versions/A/Resources/Japanese.lproj/InfoPlist.strings has changed
diff -r 38474a401742 -r 231fb0c720ae Frameworks/PSMTabBarControl.framework/Versions/A/Resources/Japanese.lproj/Inspector.nib
Binary file Frameworks/PSMTabBarControl.framework/Versions/A/Resources/Japanese.lproj/Inspector.nib has changed
diff -r 38474a401742 -r 231fb0c720ae Frameworks/PSMTabBarControl.framework/Versions/A/Resources/Japanese.lproj/Library.nib
Binary file Frameworks/PSMTabBarControl.framework/Versions/A/Resources/Japanese.lproj/Library.nib has changed
diff -r 38474a401742 -r 231fb0c720ae Frameworks/PSMTabBarControl.framework/Versions/A/Resources/largeImage.png
Binary file Frameworks/PSMTabBarControl.framework/Versions/A/Resources/largeImage.png has changed
diff -r 38474a401742 -r 231fb0c720ae Frameworks/Sparkle.framework/Versions/A/Headers/SUAppcastItem.h
--- a/Frameworks/Sparkle.framework/Versions/A/Headers/SUAppcastItem.h Fri Apr 26 18:36:46 2013 +0200
+++ b/Frameworks/Sparkle.framework/Versions/A/Headers/SUAppcastItem.h Fri May 03 00:06:06 2013 +0200
@@ -20,6 +20,7 @@
NSString *DSASignature;
NSString *minimumSystemVersion;
+ NSString *maximumSystemVersion;
NSURL *fileURL;
NSString *versionString;
@@ -45,6 +46,7 @@
- (NSURL *)fileURL;
- (NSString *)DSASignature;
- (NSString *)minimumSystemVersion;
+- (NSString *)maximumSystemVersion;
- (NSDictionary *)deltaUpdates;
- (BOOL)isDeltaUpdate;
diff -r 38474a401742 -r 231fb0c720ae Frameworks/Sparkle.framework/Versions/A/Headers/SUUpdater.h
--- a/Frameworks/Sparkle.framework/Versions/A/Headers/SUUpdater.h Fri Apr 26 18:36:46 2013 +0200
+++ b/Frameworks/Sparkle.framework/Versions/A/Headers/SUUpdater.h Fri May 03 00:06:06 2013 +0200
@@ -27,12 +27,12 @@
+ (SUUpdater *)sharedUpdater;
+ (SUUpdater *)updaterForBundle:(NSBundle *)bundle;
-- initForBundle:(NSBundle *)bundle;
+- (id)initForBundle:(NSBundle *)bundle;
- (NSBundle *)hostBundle;
- (void)setDelegate:(id)delegate;
-- delegate;
+- (id)delegate;
- (void)setAutomaticallyChecksForUpdates:(BOOL)automaticallyChecks;
- (BOOL)automaticallyChecksForUpdates;
diff -r 38474a401742 -r 231fb0c720ae Frameworks/Sparkle.framework/Versions/A/Resources/Info.plist
--- a/Frameworks/Sparkle.framework/Versions/A/Resources/Info.plist Fri Apr 26 18:36:46 2013 +0200
+++ b/Frameworks/Sparkle.framework/Versions/A/Resources/Info.plist Fri May 03 00:06:06 2013 +0200
@@ -3,7 +3,7 @@
<plist version="1.0">
<dict>
<key>BuildMachineOSBuild</key>
- <string>11C74</string>
+ <string>12D78</string>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
@@ -21,20 +21,20 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
- <string>290f64f</string>
+ <string>0ed83cf</string>
<key>DTCompiler</key>
<string>com.apple.compilers.llvm.clang.1_0</string>
<key>DTPlatformBuild</key>
- <string>4D199</string>
+ <string>4H1003</string>
<key>DTPlatformVersion</key>
<string>GM</string>
<key>DTSDKBuild</key>
- <string>10K549</string>
+ <string>11E52</string>
<key>DTSDKName</key>
- <string>macosx10.6</string>
+ <string>macosx10.7</string>
<key>DTXcode</key>
- <string>0420</string>
+ <string>0462</string>
<key>DTXcodeBuild</key>
- <string>4D199</string>
+ <string>4H1003</string>
</dict>
</plist>
diff -r 38474a401742 -r 231fb0c720ae Frameworks/Sparkle.framework/Versions/A/Resources/License.txt
--- a/Frameworks/Sparkle.framework/Versions/A/Resources/License.txt Fri Apr 26 18:36:46 2013 +0200
+++ b/Frameworks/Sparkle.framework/Versions/A/Resources/License.txt Fri May 03 00:06:06 2013 +0200
@@ -10,121 +10,6 @@
EXTERNAL LICENSES
=================
More information about the commits
mailing list