adium-1.4 3526:3ef930b8c262: Better default for allowedCharacter...
commits at adium.im
commits at adium.im
Fri Jun 24 21:04:20 UTC 2011
details: http://hg.adium.im/adium-1.4/rev/3ef930b8c262
revision: 3526:3ef930b8c262
branch: facebook-xmpp
author: Evan Schoenberg
date: Fri Jun 24 16:03:23 2011 -0500
Better default for allowedCharacters: [[NSCharacterSet illegalCharacterSet] invertedSet]
Subject: adium-1.4 3527:8ba5791c2240: label improvements
details: http://hg.adium.im/adium-1.4/rev/8ba5791c2240
revision: 3527:8ba5791c2240
branch: facebook-xmpp
author: Evan Schoenberg
date: Fri Jun 24 16:03:48 2011 -0500
label improvements
Subject: adium-1.4 3528:7e2f115c4422: Remove unneeded parts of the old facebook account code. Refs #15077
details: http://hg.adium.im/adium-1.4/rev/7e2f115c4422
revision: 3528:7e2f115c4422
branch: facebook-xmpp
author: Evan Schoenberg
date: Fri Jun 24 16:04:07 2011 -0500
Remove unneeded parts of the old facebook account code. Refs #15077
diffs (152 lines):
diff -r d591088f7a6f -r 7e2f115c4422 Frameworks/Adium Framework/Source/AIService.m
--- a/Frameworks/Adium Framework/Source/AIService.m Fri Jun 24 15:55:08 2011 -0500
+++ b/Frameworks/Adium Framework/Source/AIService.m Fri Jun 24 16:04:07 2011 -0500
@@ -262,7 +262,7 @@
*/
- (NSCharacterSet *)allowedCharacters
{
- return nil;
+ return [[NSCharacterSet illegalCharacterSet] invertedSet];
}
/*!
diff -r d591088f7a6f -r 7e2f115c4422 Plugins/Purple Service/AIFacebookXMPPService.m
--- a/Plugins/Purple Service/AIFacebookXMPPService.m Fri Jun 24 15:55:08 2011 -0500
+++ b/Plugins/Purple Service/AIFacebookXMPPService.m Fri Jun 24 16:04:07 2011 -0500
@@ -74,12 +74,15 @@
}
- (NSString *)userNameLabel{
- return AILocalizedString(@"Email",nil);
+ return AILocalizedString(@"Email", "Used as a label for a username specified by email address");
+}
+- (NSString *)contactUserNameLabel{
+ return AILocalizedString(@"Facebook Email", "Label for the username for a Facebook contact");
}
/* Allow any characters; technically this should be the email-acceptable-characters regexp. */
- (NSCharacterSet *)allowedCharacters{
- return nil;
+ return [[NSCharacterSet illegalCharacterSet] invertedSet];
}
- (AIServiceImportance)serviceImportance
diff -r d591088f7a6f -r 7e2f115c4422 Plugins/Purple Service/PurpleFacebookAccount.m
--- a/Plugins/Purple Service/PurpleFacebookAccount.m Fri Jun 24 15:55:08 2011 -0500
+++ b/Plugins/Purple Service/PurpleFacebookAccount.m Fri Jun 24 16:04:07 2011 -0500
@@ -37,115 +37,4 @@
return "prpl-bigbrownchunx-facebookim";
}
-- (NSString *)webProfileStringForContact:(AIListContact *)contact
-{
- return [NSString stringWithFormat:NSLocalizedString(@"View %@'s Facebook profile", nil),
- contact.displayName];
-}
-
-- (void)configurePurpleAccount
-{
- [super configurePurpleAccount];
-
- /* We could add a pref for this, but not without some enhancements to mail notifications. Currently, this being
- * enabled means ugly nasty "You have new mail!" popups continuously, since that's how 'notifications' are passed
- * to us.
- */
- purple_account_set_bool(account, "facebook_get_notifications", FALSE);
-
- // We do our own history; don't let the server's history get displayed as new messages
- purple_account_set_bool(account, "facebook_show_history", FALSE);
-
- // Use friends list as groups. This also allows moving between groups through libpurple
- purple_account_set_bool(account, "facebook_use_groups", TRUE);
-
- /* Don't prompt for authorization. Don't delete friends from the Facebook friend list,
- * as doing so is not a clear way to remove the friend entirely but that's what would
- * happen. Adding friends isn't supported, anyways.
- */
- purple_account_set_bool(account, "facebook_manage_friends", FALSE);
-
- // Disable the Facebook CAPTCHA since it causes heartache and pain.
- purple_account_set_bool(account, "ignore-facebook-captcha", TRUE);
-}
-
-- (BOOL)contactListEditable
-{
- return NO;
-}
-
-- (NSString *)host
-{
- return @"login.facebook.com";
-}
-
-- (const char *)purpleStatusIDForStatus:(AIStatus *)statusState
- arguments:(NSMutableDictionary *)arguments
-{
- if (statusState.statusType == AIOfflineStatusType) {
- return "offline";
- } else {
- return "available";
- }
-}
-
-- (void)setSocialNetworkingStatusMessage:(NSAttributedString *)statusMessage
-{
- NSMutableDictionary *arguments = [NSMutableDictionary dictionary];
- NSString *encodedStatusMessage = (statusMessage ?
- [self encodedAttributedString:statusMessage
- forStatusState:nil] :
- nil);
- if (encodedStatusMessage) {
- [arguments setObject:encodedStatusMessage
- forKey:@"message"];
- }
-
- purple_account_set_bool(account, "facebook_set_status_through_pidgin", TRUE);
- [self setStatusState:nil
- statusID:"available" /* facebook only supports available */
- isActive:[NSNumber numberWithBool:YES]
- arguments:arguments];
- purple_account_set_bool(account, "facebook_set_status_through_pidgin", FALSE);
-}
-
-- (NSString *)encodedAttributedString:(NSAttributedString *)inAttributedString forListObject:(AIListObject *)inListObject
-{
- return [AIHTMLDecoder encodeHTML:inAttributedString
- headers:YES
- fontTags:YES
- includingColorTags:YES
- closeFontTags:YES
- styleTags:YES
- closeStyleTagsOnFontChange:YES
- encodeNonASCII:NO
- encodeSpaces:NO
- imagesPath:nil
- attachmentsAsText:YES
- onlyIncludeOutgoingImages:NO
- simpleTagsOnly:NO
- bodyBackground:NO
- allowJavascriptURLs:YES];
-}
-
-/*!
- * @brief Set an alias for a contact
- *
- * Normally, we consider the name a 'serverside alias' unless it matches the UID's characters
- * However, the UID in facebook should never be presented to the user if possible; it's for internal use
- * only. We'll therefore consider any alias a formatted UID such that it will replace the UID when displayed
- * in Adium.
- */
-- (void)updateContact:(AIListContact *)theContact toAlias:(NSString *)purpleAlias
-{
- if (![purpleAlias isEqualToString:theContact.formattedUID] &&
- ![purpleAlias isEqualToString:theContact.UID]) {
- [theContact setFormattedUID:purpleAlias
- notify:NotifyLater];
-
- //Apply any changes
- [theContact notifyOfChangedPropertiesSilently:silentAndDelayed];
- }
-}
-
@end
More information about the commits
mailing list