# HG changeset patch # User William Bowling # Date 1257050253 -39600 # Node ID 3b45cc82a83936e59d5cec1121f85879b5c3f2d3 # Parent 28d2f716a225219acfbc961064ed41e1134c085b # Parent 5f505ec17e258c7571eaf59a9f44e332904a86c1 erg diff -r 28d2f716a225219acfbc961064ed41e1134c085b -r 3b45cc82a83936e59d5cec1121f85879b5c3f2d3 Frameworks/Adium Framework/Source/AIMessageEntryTextView.m --- a/Frameworks/Adium Framework/Source/AIMessageEntryTextView.m Sat Oct 31 23:36:14 2009 -0400 +++ b/Frameworks/Adium Framework/Source/AIMessageEntryTextView.m Sun Nov 01 15:37:33 2009 +1100 @@ -41,6 +41,8 @@ #import +#import + #define MAX_HISTORY 25 //Number of messages to remember in history #define ENTRY_TEXTVIEW_PADDING 6 //Padding for auto-sizing @@ -274,6 +276,7 @@ } } else if (associatedView && + [(WebFrameView *)associatedView allowsScrolling] && (inChar == NSPageUpFunctionKey || inChar == NSPageDownFunctionKey)) { [associatedView keyDown:inEvent]; diff -r 28d2f716a225219acfbc961064ed41e1134c085b -r 3b45cc82a83936e59d5cec1121f85879b5c3f2d3 Plugins/Purple Service/AIIRCServicesPasswordPlugin.m --- a/Plugins/Purple Service/AIIRCServicesPasswordPlugin.m Sat Oct 31 23:36:14 2009 -0400 +++ b/Plugins/Purple Service/AIIRCServicesPasswordPlugin.m Sun Nov 01 15:37:33 2009 +1100 @@ -113,6 +113,8 @@ if ([account boolValueForProperty:@"Identifying"]) { [account setValue:nil forProperty:@"Identifying" notify:NotifyNever]; contentObject.displayContent = NO; + } else if ([message rangeOfString:@"you are already logged in" options:NSCaseInsensitiveSearch].location != NSNotFound) { + contentObject.displayContent = NO; } } else if ([self message:message containsFragments:[NSArray arrayWithObjects: @"before it is changed", diff -r 28d2f716a225219acfbc961064ed41e1134c085b -r 3b45cc82a83936e59d5cec1121f85879b5c3f2d3 Plugins/Purple Service/ESIRCAccount.m --- a/Plugins/Purple Service/ESIRCAccount.m Sat Oct 31 23:36:14 2009 -0400 +++ b/Plugins/Purple Service/ESIRCAccount.m Sun Nov 01 15:37:33 2009 +1100 @@ -133,7 +133,7 @@ if (!connection) return; - + const char *quote = [command UTF8String]; irc_cmd_quote(connection->proto_data, NULL, NULL, "e); } @@ -164,14 +164,14 @@ - (NSString *)encodedAttributedStringForSendingContentMessage:(AIContentMessage *)inContentMessage { - + NSString *encodedString = nil; BOOL didCommand = [self.purpleAdapter attemptPurpleCommandOnMessage:inContentMessage.message.string - fromAccount:(AIAccount *)inContentMessage.source - inChat:inContentMessage.chat]; + fromAccount:(AIAccount *)inContentMessage.source + inChat:inContentMessage.chat]; NSRange meRange = [inContentMessage.message.string rangeOfString:@"/me " options:NSCaseInsensitiveSearch]; - + if (!didCommand || meRange.location == 0) { if (meRange.location == 0) { inContentMessage.sendContent = NO; @@ -229,7 +229,7 @@ - (void)configurePurpleAccount { [super configurePurpleAccount]; - + purple_account_set_username(self.purpleAccount, self.purpleAccountName); // Encoding @@ -344,7 +344,7 @@ ([source rangeOfString:@"-connect" options:(NSBackwardsSearch | NSCaseInsensitiveSearch | NSAnchoredSearch)].location != NSNotFound))) { shouldLog = NO; } - + return (shouldLog && [super shouldLogChat:chat]); } @@ -393,11 +393,11 @@ } menu = [adium.menuController contextualMenuWithLocations:[NSArray arrayWithObjects: - [NSNumber numberWithInteger:Context_Contact_GroupChat_ParticipantAction], - [NSNumber numberWithInteger:Context_Contact_Manage], - nil] - forListObject:listObject - inChat:chat]; + [NSNumber numberWithInteger:Context_Contact_GroupChat_ParticipantAction], + [NSNumber numberWithInteger:Context_Contact_Manage], + nil] + forListObject:listObject + inChat:chat]; @@ -426,7 +426,7 @@ action:@selector(devoice) keyEquivalent:@"" tag:AIRequiresOp]; - + [menu addItem:[NSMenuItem separatorItem]]; [menu addItemWithTitle:AILocalizedString(@"Kick", nil) @@ -455,7 +455,7 @@ AIOperationRequirement req = menuItem.tag; AIChat *chat = adium.interfaceController.activeChat; BOOL anySelected = chat.chatContainer.messageViewController.selectedListObjects.count > 0; - + AIGroupChatFlags flags = [self flagsInChat:chat]; switch (req) { diff -r 28d2f716a225219acfbc961064ed41e1134c085b -r 3b45cc82a83936e59d5cec1121f85879b5c3f2d3 Plugins/Purple Service/PurpleFacebookAccount.m --- a/Plugins/Purple Service/PurpleFacebookAccount.m Sat Oct 31 23:36:14 2009 -0400 +++ b/Plugins/Purple Service/PurpleFacebookAccount.m Sun Nov 01 15:37:33 2009 +1100 @@ -11,6 +11,10 @@ #import #import +#import "PurpleFacebookService.h" +#import +#import + @implementation PurpleFacebookAccount - (const char*)protocolPlugin @@ -20,7 +24,7 @@ - (NSString *)webProfileStringForContact:(AIListContact *)contact { - return [NSString stringWithFormat:NSLocalizedString(@"View %@'s Facebook profile", nil), + return [NSString stringWithFormat:AILocalizedString(@"View %@'s Facebook profile", nil), contact.displayName]; } @@ -109,4 +113,58 @@ } } +#pragma mark Menu Items +/*! + * @brief Menu items for contact + * + * Returns an array of menu items for a contact on this account. This is the best place to add protocol-specific + * actions that aren't otherwise supported by Adium. + * @param inContact AIListContact for menu items + * @return NSArray of NSMenuItem instances for the passed contact + */ +- (NSArray *)menuItemsForContact:(AIListContact *)inContact +{ + NSMutableArray *menuItemArray = [NSMutableArray array]; + + //Fill with any items supplied by libpurple + [menuItemArray addObjectsFromArray:[super menuItemsForContact:inContact]]; + + + //Add a new menu item with the facebook icon to view the contacts profile + NSMenuItem *menuItem; + NSImage *serviceIcon = [AIServiceIcons serviceIconForService:self.service + type:AIServiceIconSmall + direction:AIIconNormal]; + + menuItem = [[[NSMenuItem allocWithZone:[NSMenu menuZone]] initWithTitle:[NSString stringWithFormat:AILocalizedString(@"View %@'s Facebook profile", nil), inContact.displayName] + target:self + action:@selector(viewFacebookProfile:) + keyEquivalent:@""] autorelease]; + [menuItem setImage:serviceIcon]; + [menuItem setRepresentedObject:inContact]; + [menuItemArray addObject:menuItem]; + + + //Don't return an empty array + if (![menuItemArray count]) menuItemArray = nil; + + return menuItemArray; +} + + +/*! + * @brief Open Facebook Profile + * + * Opens the selected contacts or chats facebook profile in the default web browser + */ +- (void)viewFacebookProfile:(NSMenuItem *)menuItem +{ + AIListContact *contact = (AIListContact *)menuItem.representedObject; + NSString *url = [NSString stringWithFormat:@"http://www.facebook.com/profile.php?id=%@",[contact UID]]; + [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:url]]; +} + + + + @end diff -r 28d2f716a225219acfbc961064ed41e1134c085b -r 3b45cc82a83936e59d5cec1121f85879b5c3f2d3 Plugins/Purple Service/adiumPurpleConversation.m --- a/Plugins/Purple Service/adiumPurpleConversation.m Sat Oct 31 23:36:14 2009 -0400 +++ b/Plugins/Purple Service/adiumPurpleConversation.m Sun Nov 01 15:37:33 2009 +1100 @@ -225,6 +225,15 @@ } AILog(@"*** Conversation error %@: %@", chat, messageString); + + } else if (flags & PURPLE_MESSAGE_RAW) + { + [adium.contentController performSelector:@selector(displayEvent:ofType:inChat:) + withObject:messageString + withObject:@"libpurpleMessage" + withObject:chat + afterDelay:0]; + } else { BOOL shouldDisplayMessage = TRUE; if (strcmp(message, _("Direct IM established")) == 0) { diff -r 28d2f716a225219acfbc961064ed41e1134c085b -r 3b45cc82a83936e59d5cec1121f85879b5c3f2d3 Source/AIListWindowController.m --- a/Source/AIListWindowController.m Sat Oct 31 23:36:14 2009 -0400 +++ b/Source/AIListWindowController.m Sun Nov 01 15:37:33 2009 +1100 @@ -723,7 +723,7 @@ if (windowHidingStyle == AIContactListWindowHidingStyleSliding) { [self setWindowLevel:NSFloatingWindowLevel]; - [[self window] setCollectionBehavior:NSWindowCollectionBehaviorCanJoinAllSpaces]; + [[self window] setCollectionBehavior:showOnAllSpaces ? NSWindowCollectionBehaviorCanJoinAllSpaces : NSWindowCollectionBehaviorDefault]; overrodeWindowLevel = YES; }