[Adium-commits] adium 2063:dd094c7840a5: Backed out changeset 699c59465ff3
adium-commits at adiumx.com
adium-commits at adiumx.com
Sat May 2 19:52:00 UTC 2009
details: http://hg.adiumx.com/adium/rev/dd094c7840a5
revision: 2063:dd094c7840a5
author: Zachary West <zacw at adiumx.com>
date: Sat May 02 15:50:43 2009 -0400
Backed out changeset 699c59465ff3
Subject: adium 2064:52cb1a7068d9: Merge.
details: http://hg.adiumx.com/adium/rev/52cb1a7068d9
revision: 2064:52cb1a7068d9
author: Zachary West <zacw at adiumx.com>
date: Sat May 02 15:51:23 2009 -0400
Merge.
Subject: adium 2065:7e3a5f7d5734: Backed out changeset 86ee99ab9534
details: http://hg.adiumx.com/adium/rev/7e3a5f7d5734
revision: 2065:7e3a5f7d5734
author: Zachary West <zacw at adiumx.com>
date: Sat May 02 15:51:37 2009 -0400
Backed out changeset 86ee99ab9534
Subject: adium 2066:becca8ee45f7: Merge
details: http://hg.adiumx.com/adium/rev/becca8ee45f7
revision: 2066:becca8ee45f7
author: Zachary West <zacw at adiumx.com>
date: Sat May 02 15:51:45 2009 -0400
Merge
diffstat:
Frameworks/Adium Framework/Source/AIAbstractAccount.m | 1 -
Frameworks/Adium Framework/Source/AIAbstractListController.m | 4 +-
Frameworks/Adium Framework/Source/AIAdiumProtocol.h | 4 -
Frameworks/Adium Framework/Source/AIDebugControllerProtocol.h | 2 -
Frameworks/Adium Framework/Source/ESDebugAILog.h | 24 ++---
Frameworks/Adium Framework/Source/ESDebugAILog.m | 43 ++++++----
Frameworks/libpurple.framework/Versions/0.6.0/libpurple |
Plugins/Purple Service/adiumPurpleConversation.h | 1 +
Plugins/Purple Service/adiumPurpleConversation.m | 10 +-
Plugins/Twitter Plugin/AITwitterAccount.m | 6 +-
Plugins/Twitter Plugin/AITwitterURLHandler.m | 48 +++++------
Release/Artwork/dmgBackground.png |
Release/Artwork/dmgBackground.psd.tgz |
Release/make-diskimage.sh | 2 +-
Source/AIAdium.h | 3 -
Source/AIAdium.m | 28 +-----
Source/AICoreComponentLoader.m | 8 +-
Source/AIURLShortenerPlugin.m | 6 +-
Source/ESDebugController.h | 3 -
Source/ESDebugController.m | 46 +++++------
Source/ESDebugWindowController.h | 3 -
Source/ESDebugWindowController.m | 3 -
Utilities/dep-build-scripts/common.sh | 2 -
Utilities/dep-build-scripts/general_dependencies_make.sh | 19 ++--
Utilities/dep-build-scripts/glibconfig.h | 2 -
Utilities/dep-build-scripts/libgadu.h | 2 -
Utilities/dep-build-scripts/purple_dependencies_make.sh | 18 +---
Utilities/dep-build-scripts/universalize.sh | 3 -
28 files changed, 120 insertions(+), 171 deletions(-)
diffs (884 lines):
diff -r 699c59465ff3 -r becca8ee45f7 Frameworks/Adium Framework/Source/AIAbstractAccount.m
--- a/Frameworks/Adium Framework/Source/AIAbstractAccount.m Thu Apr 30 20:32:46 2009 -0700
+++ b/Frameworks/Adium Framework/Source/AIAbstractAccount.m Sat May 02 15:51:45 2009 -0400
@@ -1328,7 +1328,6 @@
// If we know this connection is waiting for the network to return, don't bother continuing to reconnect.
// Let it try for 2 times and then cancel and wait for the network to return.
[self cancelAutoReconnect];
-
AILog(@"%@: Disconnected (\"%@\"): Waiting until network returns.", self, lastDisconnectionError);
} else if ([self shouldBeOnline] && lastDisconnectionError) {
diff -r 699c59465ff3 -r becca8ee45f7 Frameworks/Adium Framework/Source/AIAbstractListController.m
--- a/Frameworks/Adium Framework/Source/AIAbstractListController.m Thu Apr 30 20:32:46 2009 -0700
+++ b/Frameworks/Adium Framework/Source/AIAbstractListController.m Sat May 02 15:51:45 2009 -0400
@@ -572,7 +572,7 @@
//Redraw the modified object (or the whole list, if object is nil)
if (object) {
- for (AIProxyListObject *proxyObject in object.proxyObjects) {
+ for (AIProxyListObject *proxyObject in [[object.proxyObjects copy] autorelease]) {
[contactListView redisplayItem:proxyObject];
}
} else {
@@ -583,7 +583,7 @@
* For example, when a contact changes, redraw the metacontact which represents it if appropriate.
*/
if (object && [object isKindOfClass:[AIListContact class]] && ([(AIListContact *)object parentContact] != object)) {
- for (AIProxyListObject *proxyObject in [(AIListContact *)object parentContact].proxyObjects) {
+ for (AIProxyListObject *proxyObject in [[[(AIListContact *)object parentContact].proxyObjects copy] autorelease]) {
[contactListView redisplayItem:proxyObject];
}
}
diff -r 699c59465ff3 -r becca8ee45f7 Frameworks/Adium Framework/Source/AIAdiumProtocol.h
--- a/Frameworks/Adium Framework/Source/AIAdiumProtocol.h Thu Apr 30 20:32:46 2009 -0700
+++ b/Frameworks/Adium Framework/Source/AIAdiumProtocol.h Sat May 02 15:51:45 2009 -0400
@@ -42,11 +42,7 @@
@property (readonly, nonatomic) NSObject<AIToolbarController> *toolbarController;
@property (readonly, nonatomic) NSObject<AIContactAlertsController> *contactAlertsController;
@property (readonly, nonatomic) NSObject<AIFileTransferController> *fileTransferController;
-
-#ifdef DEBUG_BUILD
@property (readonly, nonatomic) NSObject<AIDebugController> *debugController;
-#endif
-
@property (readonly, nonatomic) NSObject<AIApplescriptabilityController> *applescriptabilityController;
@property (readonly, nonatomic) AICoreComponentLoader *componentLoader;
diff -r 699c59465ff3 -r becca8ee45f7 Frameworks/Adium Framework/Source/AIDebugControllerProtocol.h
--- a/Frameworks/Adium Framework/Source/AIDebugControllerProtocol.h Thu Apr 30 20:32:46 2009 -0700
+++ b/Frameworks/Adium Framework/Source/AIDebugControllerProtocol.h Sat May 02 15:51:45 2009 -0400
@@ -9,9 +9,7 @@
#import <Adium/AIControllerProtocol.h>
@protocol AIDebugController <AIController>
-#ifdef DEBUG_BUILD
- (void)addMessage:(NSString *)actualMessage;
@property (nonatomic, readonly) NSArray *debugLogArray;
- (void)clearDebugLogArray;
-#endif
@end
diff -r 699c59465ff3 -r becca8ee45f7 Frameworks/Adium Framework/Source/ESDebugAILog.h
--- a/Frameworks/Adium Framework/Source/ESDebugAILog.h Thu Apr 30 20:32:46 2009 -0700
+++ b/Frameworks/Adium Framework/Source/ESDebugAILog.h Sat May 02 15:51:45 2009 -0400
@@ -14,16 +14,14 @@
* write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-#ifdef DEBUG_BUILD
-/* For a debug build, declare the AILog() function */
- void AILogWithPrefix (const char *signature, NSString *format, ...) __attribute__((format(__NSString__, 2, 3)));
- #define AILogWithSignature(fmt, args...) AILogWithPrefix(__PRETTY_FUNCTION__, fmt, ##args);
- void AILog (NSString *format, ...) __attribute__((format(__NSString__, 1, 2)));
- void AILogBacktrace();
-#else
-/* For a non-debug build, define it to be a comment so there is no overhead in using it liberally */
- #define AILog(fmt, ...) /**/
- #define AILogWithSignature(fmt, ...) /**/
- #define AILogWithPrefix(sig, fmt, ...) /**/
- #define AILogBacktrace() /**/
-#endif
+extern NSString *const AIDebugLoggingEnabledNotification;
+extern BOOL AIDebugLoggingEnabled;
+
+#define AILog(fmt, args...) do { if (__builtin_expect(AIDebugLoggingEnabled, 0)) AILog_impl(fmt, ##args); } while(0)
+#define AILogWithPrefix(sig, fmt, args...) do { if(__builtin_expect(AIDebugLoggingEnabled, 0)) AILogWithPrefix_impl(sig, fmt, ##args); } while(0)
+#define AILogBacktrace() do { if(__builtin_expect(AIDebugLoggingEnabled, 0)) AILogBacktrace_impl(); } while(0)
+#define AILogWithSignature(fmt, args...) AILogWithPrefix(__PRETTY_FUNCTION__, fmt, ##args);
+void AIEnableDebugLogging();
+void AILogWithPrefix_impl (const char *signature, NSString *format, ...) __attribute__((format(__NSString__, 2, 3)));
+void AILog_impl (NSString *format, ...) __attribute__((format(__NSString__, 1, 2)));
+void AILogBacktrace_impl();
diff -r 699c59465ff3 -r becca8ee45f7 Frameworks/Adium Framework/Source/ESDebugAILog.m
--- a/Frameworks/Adium Framework/Source/ESDebugAILog.m Thu Apr 30 20:32:46 2009 -0700
+++ b/Frameworks/Adium Framework/Source/ESDebugAILog.m Sat May 02 15:51:45 2009 -0400
@@ -16,21 +16,30 @@
#import <Adium/AIDebugControllerProtocol.h>
#include <stdarg.h>
+#include <execinfo.h>
-extern CFRunLoopRef CFRunLoopGetMain(void);
+#ifdef DEBUG_BUILD
+BOOL AIDebugLoggingEnabled = YES;
+#else
+BOOL AIDebugLoggingEnabled = NO;
+#endif
+
+NSString *const AIDebugLoggingEnabledNotification = @"AIDebugLoggingEnabledNotification";
+
+void AIEnableDebugLogging()
+{
+ AIDebugLoggingEnabled = YES;
+ [[NSNotificationCenter defaultCenter] postNotificationName:AIDebugLoggingEnabledNotification object:nil];
+}
/*!
* @brief Adium debug log function
*
- * Prints a message to the Adium debug window, which is only enabled in Debug builds.
- * In Release builds, this function is replaced by a #define which is just a comment, so there is no cost to
- * Release to use it.
+ * Prints a message to the Adium debug window, which is only enabled in Debug builds or by a hidden preference.
*
* @param format A printf-style format string
* @param ... 0 or more arguments to the format string
*/
-#ifdef DEBUG_BUILD
-#include <execinfo.h>
void AIAddDebugMessage(NSString *debugMessage)
{
NSString *actualMessage = [[[NSDate date] descriptionWithCalendarFormat:@"%H:%M:%S: "
@@ -38,7 +47,7 @@
locale:nil] stringByAppendingString:debugMessage];
/* Be careful; we should only modify debugLogArray and the windowController's view on the main thread. */
- if (CFRunLoopGetCurrent() == CFRunLoopGetMain()) {
+ if ([NSRunLoop currentRunLoop] == [NSRunLoop mainRunLoop]) {
[adium.debugController addMessage:actualMessage];
} else {
@@ -48,7 +57,7 @@
}
}
-void AILog (NSString *format, ...) {
+void AILog_impl (NSString *format, ...) {
va_list ap; /* Points to each unamed argument in turn */
NSString *debugMessage;
@@ -62,7 +71,7 @@
va_end(ap); /* clean up when done */
}
-void AILogWithPrefix (const char *prefix, NSString *format, ...) {
+void AILogWithPrefix_impl (const char *prefix, NSString *format, ...) {
va_list ap; /* Points to each unamed argument in turn */
NSString *debugMessage, *actualMessage;
@@ -77,7 +86,7 @@
va_end(ap); /* clean up when done */
}
-void AILogBacktrace() {
+void AILogBacktrace_impl() {
void* callstack[128];
int i, frames = backtrace(callstack, 128);
char** strs = backtrace_symbols(callstack, frames);
@@ -86,15 +95,13 @@
[str appendFormat:@"%s\n", strs[i]];
}
free(strs);
- AILog(@"%@", str);
+ AILog_impl(@"%@", str);
};
-#else
-//Insert a fake symbol so that plugins using AILog() don't crash.
+//For compatibility with plugins that expect these symbols to exist
#undef AILog
-void AILog (NSString *format, ...) {};
#undef AILogWithPrefix
-void AILogWithPrefix (char *sig, NSString *format, ...) {};
-#undef AILogBacktrace
-void AILogBacktrace() {};
-#endif
+#undef AILogWithBacktrace
+void AILog(NSString *fmt, ...) {}
+void AILogWithPrefix(const char *signature, NSString *fmt, ...) {}
+void AILogWithBacktrace() {}
diff -r 699c59465ff3 -r becca8ee45f7 Frameworks/libpurple.framework/Versions/0.6.0/libpurple
Binary file Frameworks/libpurple.framework/Versions/0.6.0/libpurple has changed
diff -r 699c59465ff3 -r becca8ee45f7 Plugins/Purple Service/adiumPurpleConversation.h
--- a/Plugins/Purple Service/adiumPurpleConversation.h Thu Apr 30 20:32:46 2009 -0700
+++ b/Plugins/Purple Service/adiumPurpleConversation.h Sat May 02 15:51:45 2009 -0400
@@ -18,3 +18,4 @@
PurpleConversationUiOps *adium_purple_conversation_get_ui_ops(void);
void adiumPurpleConversation_init(void);
+NSString *get_real_name_for_account_conv_buddy(PurpleAccount *account, PurpleConversation *conv, char *who);
diff -r 699c59465ff3 -r becca8ee45f7 Plugins/Purple Service/adiumPurpleConversation.m
--- a/Plugins/Purple Service/adiumPurpleConversation.m Thu Apr 30 20:32:46 2009 -0700
+++ b/Plugins/Purple Service/adiumPurpleConversation.m Sat May 02 15:51:45 2009 -0400
@@ -77,9 +77,10 @@
messageString);
NSDate *date = [NSDate dateWithTimeIntervalSince1970:mtime];
+ PurpleAccount *purpleAccount = purple_conversation_get_account(conv);
if ((flags & PURPLE_MESSAGE_SYSTEM) == PURPLE_MESSAGE_SYSTEM || !who) {
- CBPurpleAccount *account = accountLookup(purple_conversation_get_account(conv));
+ CBPurpleAccount *account = accountLookup(purpleAccount);
[account receivedEventForChat:groupChatLookupFromConv(conv)
message:messageString
@@ -88,10 +89,11 @@
} else {
NSAttributedString *attributedMessage = [AIHTMLDecoder decodeHTML:messageString];
NSNumber *purpleMessageFlags = [NSNumber numberWithInt:flags];
+ NSString *normalizedUID = get_real_name_for_account_conv_buddy(purpleAccount, conv, (char *)who);
- if (who && strlen(who)) {
+ if (normalizedUID.length) {
messageDict = [NSDictionary dictionaryWithObjectsAndKeys:attributedMessage, @"AttributedMessage",
- [NSString stringWithUTF8String:who], @"Source",
+ normalizedUID, @"Source",
purpleMessageFlags, @"PurpleMessageFlags",
date, @"Date",nil];
@@ -272,6 +274,8 @@
NSString *get_real_name_for_account_conv_buddy(PurpleAccount *account, PurpleConversation *conv, char *who)
{
+ g_return_val_if_fail(who != NULL && strlen(who), nil);
+
PurplePlugin *prpl = purple_find_prpl(purple_account_get_protocol_id(account));
PurplePluginProtocolInfo *prpl_info = (prpl ? PURPLE_PLUGIN_PROTOCOL_INFO(prpl) : NULL);
PurpleConvChat *convChat = purple_conversation_get_chat_data(conv);
diff -r 699c59465ff3 -r becca8ee45f7 Plugins/Twitter Plugin/AITwitterAccount.m
--- a/Plugins/Twitter Plugin/AITwitterAccount.m Thu Apr 30 20:32:46 2009 -0700
+++ b/Plugins/Twitter Plugin/AITwitterAccount.m Sat May 02 15:51:45 2009 -0400
@@ -1331,7 +1331,7 @@
[mutableMessage setAttributes:[NSDictionary dictionaryWithObjectsAndKeys:linkAddress, NSLinkAttributeName, nil]
range:NSMakeRange(0, replyUserID.length + 1)];
} else {
- // This probably shouldn't happen, but in case it does, we're set as in_reply_to_status_id a non-reply. link it at the ned.
+ // This happens for mentions which are in_reply_to_status_id but the @target isn't the first part of the message.
[mutableMessage appendAttributedString:[NSAttributedString attributedStringWithLinkLabel:AILocalizedString(@"IRT", "An abbreviation for 'in reply to' - placed at the beginning of the tweet tools for those which are directly in reply to another")
linkDestination:linkAddress]];
@@ -1373,6 +1373,10 @@
[mutableMessage appendAttributedString:[NSAttributedString attributedStringWithLinkLabel:@"@"
linkDestination:linkAddress]];
} else {
+ if(commaNeeded) {
+ [mutableMessage appendString:@", " withAttributes:nil];
+ }
+
// Our own message. Display a destroy link.
linkAddress = [self addressForLinkType:AITwitterLinkDestroyStatus
userID:userID
diff -r 699c59465ff3 -r becca8ee45f7 Plugins/Twitter Plugin/AITwitterURLHandler.m
--- a/Plugins/Twitter Plugin/AITwitterURLHandler.m Thu Apr 30 20:32:46 2009 -0700
+++ b/Plugins/Twitter Plugin/AITwitterURLHandler.m Sat May 02 15:51:45 2009 -0400
@@ -30,6 +30,7 @@
#import <Adium/AIAccountControllerProtocol.h>
#import <Adium/AIChatControllerProtocol.h>
#import <Adium/AIInterfaceControllerProtocol.h>
+#import <Adium/AIContentControllerProtocol.h>
@implementation AITwitterURLHandler
@@ -128,7 +129,14 @@
}
if (![textView.string hasPrefix:prefix]) {
- NSMutableAttributedString *newString = [[[NSAttributedString stringWithString:prefix] mutableCopy] autorelease];
+ NSMutableAttributedString *newString;
+ if (textView.attributedString.length > 0){
+ newString = [[[textView.attributedString attributedSubstringFromRange:NSMakeRange(0, 1)] mutableCopy] autorelease];
+ [newString replaceCharactersInRange:NSMakeRange(0, 1) withString:prefix];
+ }
+ else
+ newString = [[[NSMutableAttributedString alloc] initWithString:prefix attributes:[adium.contentController defaultFormattingAttributes]] autorelease];
+
[newString appendAttributedString:textView.attributedString];
[textView setAttributedString:newString];
@@ -140,17 +148,15 @@
// Make the text view have focus
[[adium.interfaceController windowForChat:timelineChat] makeFirstResponder:textView];
- if([inAction isEqualToString:@"reply"]) {
- [timelineChat setValue:inTweet forProperty:@"TweetInReplyToStatusID" notify:NotifyNow];
- [timelineChat setValue:inUser forProperty:@"TweetInReplyToUserID" notify:NotifyNow];
- [timelineChat setValue:@"@" forProperty:@"Character Counter Prefix" notify:NotifyNow];
-
- AILogWithSignature(@"Flagging chat %@ to in_reply_to_status_id = %@", timelineChat, inTweet);
-
- [[NSNotificationCenter defaultCenter] removeObserver:self name:NSTextDidChangeNotification object:textView];
-
- [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(textDidChange:) name:NSTextDidChangeNotification object:textView];
- }
+ [timelineChat setValue:inTweet forProperty:@"TweetInReplyToStatusID" notify:NotifyNow];
+ [timelineChat setValue:inUser forProperty:@"TweetInReplyToUserID" notify:NotifyNow];
+ [timelineChat setValue:@"@" forProperty:@"Character Counter Prefix" notify:NotifyNow];
+
+ AILogWithSignature(@"Flagging chat %@ to in_reply_to_status_id = %@", timelineChat, inTweet);
+
+ [[NSNotificationCenter defaultCenter] removeObserver:self name:NSTextDidChangeNotification object:textView];
+
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(textDidChange:) name:NSTextDidChangeNotification object:textView];
} else if ([inAction isEqualToString:@"favorite"]) {
[account toggleFavoriteTweet:inTweet];
} else if ([inAction isEqualToString:@"destroy"] && exactMatchForInternalID) {
@@ -179,7 +185,6 @@
AIMessageEntryTextView *textView = [notification object];
AIChat *chat = textView.chat;
- AIAccount *account = chat.account;
if(![chat valueForProperty:@"TweetInReplyToStatusID"] || ![chat valueForProperty:@"TweetInReplyToUserID"]) {
[[NSNotificationCenter defaultCenter] removeObserver:self name:NSTextDidChangeNotification object:textView];
@@ -189,20 +194,9 @@
NSString *contents = [textView string];
BOOL keepTweetValues = YES;
- if([contents hasPrefix:@"@"]) {
- NSString *replyUsername = [contents substringFromIndex:1];
- NSRange usernameRange = [replyUsername rangeOfCharacterFromSet:[account.service.allowedCharacters invertedSet]];
-
- if(usernameRange.location == NSNotFound) {
- usernameRange = NSMakeRange([replyUsername length], 0);
- }
-
- replyUsername = [replyUsername substringToIndex:usernameRange.location];
-
- if (![replyUsername isEqualToString:[chat valueForProperty:@"TweetInReplyToUserID"]]) {
- keepTweetValues = NO;
- }
- } else {
+ NSRange usernameRange = [contents rangeOfString:[NSString stringWithFormat:@"@%@", [chat valueForProperty:@"TweetInReplyToUserID"]]];
+
+ if (usernameRange.location == NSNotFound) {
keepTweetValues = NO;
}
diff -r 699c59465ff3 -r becca8ee45f7 Release/Artwork/dmgBackground.png
Binary file Release/Artwork/dmgBackground.png has changed
diff -r 699c59465ff3 -r becca8ee45f7 Release/Artwork/dmgBackground.psd.tgz
Binary file Release/Artwork/dmgBackground.psd.tgz has changed
diff -r 699c59465ff3 -r becca8ee45f7 Release/make-diskimage.sh
--- a/Release/make-diskimage.sh Thu Apr 30 20:32:46 2009 -0700
+++ b/Release/make-diskimage.sh Sat May 02 15:51:45 2009 -0400
@@ -63,7 +63,7 @@
# compress image
echo "Compressing disk image..."
-hdiutil convert "${DMG_TEMP_NAME}" -format UDZO -imagekey zlib-level=9 -o "${DMG_DIR}/${DMG_NAME}"
+hdiutil convert "${DMG_TEMP_NAME}" -format UDBZ -o "${DMG_DIR}/${DMG_NAME}"
rm -f "${DMG_TEMP_NAME}"
# adding EULA resources
diff -r 699c59465ff3 -r becca8ee45f7 Source/AIAdium.h
--- a/Source/AIAdium.h Thu Apr 30 20:32:46 2009 -0700
+++ b/Source/AIAdium.h Sat May 02 15:51:45 2009 -0400
@@ -52,10 +52,7 @@
NSObject <AIContactAlertsController> *contactAlertsController;
NSObject <AIFileTransferController> *fileTransferController;
NSObject <AIApplescriptabilityController> *applescriptabilityController;
-
-#ifdef DEBUG_BUILD
NSObject <AIDebugController> *debugController;
-#endif
AICoreComponentLoader *componentLoader;
AICorePluginLoader *pluginLoader;
diff -r 699c59465ff3 -r becca8ee45f7 Source/AIAdium.m
--- a/Source/AIAdium.m Thu Apr 30 20:32:46 2009 -0700
+++ b/Source/AIAdium.m Sat May 02 15:51:45 2009 -0400
@@ -53,10 +53,7 @@
#import "ESAddressBookIntegrationAdvancedPreferences.h"
#import <Adium/AdiumAuthorization.h>
#import <sys/sysctl.h>
-
-#ifdef DEBUG_BUILD
#import "ESDebugController.h"
-#endif
#define ADIUM_TRAC_PAGE @"http://trac.adiumx.com/"
#define ADIUM_REPORT_BUG_PAGE @"http://trac.adiumx.com/wiki/ReportingBugs"
@@ -90,11 +87,7 @@
//Core Controllers -----------------------------------------------------------------------------------------------------
#pragma mark Core Controllers
- at synthesize accountController, chatController, contactController, contentController, dockController, emoticonController, interfaceController, loginController, menuController, preferenceController, soundController, statusController, toolbarController, contactAlertsController, fileTransferController, applescriptabilityController;
-
-#ifdef DEBUG_BUILD
- at synthesize debugController;
-#endif
+ at synthesize accountController, chatController, contactController, contentController, dockController, emoticonController, interfaceController, loginController, menuController, preferenceController, soundController, statusController, toolbarController, contactAlertsController, fileTransferController, applescriptabilityController, debugController;
//Loaders --------------------------------------------------------------------------------------------------------
#pragma mark Loaders
@@ -167,20 +160,16 @@
//Called by the login controller when a user has been selected, continue logging in
- (void)completeLogin
{
- NSAutoreleasePool *pool;
-
- pool = [[NSAutoreleasePool alloc] init];
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
/* Init the controllers.
* Menu and interface controllers are created by MainMenu.nib when it loads.
*/
preferenceController = [[AIPreferenceController alloc] init];
toolbarController = [[AIToolbarController alloc] init];
-
-#ifdef DEBUG_BUILD
debugController = [[ESDebugController alloc] init];
-#endif
-
+ if ([[NSUserDefaults standardUserDefaults] boolForKey:@"AIEnableDebugLogging"])
+ AIEnableDebugLogging();
contactAlertsController = [[ESContactAlertsController alloc] init];
soundController = [[AISoundController alloc] init];
emoticonController = [[AIEmoticonController alloc] init];
@@ -197,9 +186,7 @@
//Finish setting up the preference controller before the components and plugins load so they can read prefs
[preferenceController controllerDidLoad];
-#ifdef DEBUG_BUILD
[debugController controllerDidLoad];
-#endif
[pool release];
//Plugins and components should always init last, since they rely on everything else.
@@ -372,9 +359,7 @@
[soundController controllerWillClose];
[menuController controllerWillClose];
[applescriptabilityController controllerWillClose];
-#ifdef DEBUG_BUILD
[debugController controllerWillClose];
-#endif
[toolbarController controllerWillClose];
[AISharedWriterQueue waitUntilAllOperationsAreFinished];
@@ -390,10 +375,7 @@
movingToTrash:NO];
}
-- (BOOL)isQuitting
-{
- return isQuitting;
-}
+ at synthesize isQuitting;
//Menu Item Hooks ------------------------------------------------------------------------------------------------------
#pragma mark Menu Item Hooks
diff -r 699c59465ff3 -r becca8ee45f7 Source/AICoreComponentLoader.m
--- a/Source/AICoreComponentLoader.m Thu Apr 30 20:32:46 2009 -0700
+++ b/Source/AICoreComponentLoader.m Sat May 02 15:51:45 2009 -0400
@@ -83,7 +83,6 @@
@"AIContactStatusColoringPlugin",
@"AIContactStatusDockOverlaysPlugin",
@"AIContactStatusEventsPlugin",
- @"AIDefaultFormattingPlugin",
@"AIDockAccountStatusPlugin",
@"AIDockBehaviorPlugin",
@"AIDockUnviewedContentPlugin",
@@ -118,7 +117,7 @@
@"ESContactClientPlugin",
@"ESContactServersideDisplayName",
@"ESFileTransferMessagesPlugin",
- @"ESMetaContactContentsPlugin",
+ @"AIListObjectContentsPlugin",
@"ESOpenMessageWindowContactAlertPlugin",
@"ESSafariLinkToolbarItemPlugin",
@"ESSendMessageContactAlertPlugin",
@@ -145,7 +144,6 @@
@"AINulRemovalPlugin",
@"AIAdvancedPreferencesPlugin",
@"GBImportPlugin",
- @"AIContactVisibilityPlugin",
@"AIMentionEventPlugin",
@"AITwitterIMPlugin",
@"AITwitterPlugin",
@@ -181,7 +179,9 @@
[components setObject:object forKey:className];
[object release];
- }
+ } else {
+ NSAssert1(NO, @"Failed to load %@", className);
+ }
[pool release];
#ifdef COMPONENT_LOAD_TIMING
NSTimeInterval t = -[start timeIntervalSinceNow];
diff -r 699c59465ff3 -r becca8ee45f7 Source/AIURLShortenerPlugin.m
--- a/Source/AIURLShortenerPlugin.m Thu Apr 30 20:32:46 2009 -0700
+++ b/Source/AIURLShortenerPlugin.m Sat May 02 15:51:45 2009 -0400
@@ -277,9 +277,11 @@
NSRange selectedRange = textView.selectedRange;
// Replace the current selection with the new URL
+ NSMutableDictionary *attrs = [NSMutableDictionary dictionaryWithDictionary:[textView.attributedString attributesAtIndex:selectedRange.location effectiveRange:nil]];
+ [attrs setObject:shortenedURL forKey:NSLinkAttributeName];
+
[textView.textStorage replaceCharactersInRange:selectedRange
- withAttributedString:[NSAttributedString attributedStringWithLinkLabel:shortenedURL
- linkDestination:shortenedURL]];
+ withAttributedString:[[[NSAttributedString alloc] initWithString:shortenedURL attributes:attrs] autorelease]];
// Select the inserted URL
textView.selectedRange = NSMakeRange(selectedRange.location, shortenedURL.length);
diff -r 699c59465ff3 -r becca8ee45f7 Source/ESDebugController.h
--- a/Source/ESDebugController.h Thu Apr 30 20:32:46 2009 -0700
+++ b/Source/ESDebugController.h Sat May 02 15:51:45 2009 -0400
@@ -13,7 +13,6 @@
* You should have received a copy of the GNU General Public License along with this program; if not,
* write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-#ifdef DEBUG_BUILD
#import <Adium/AIDebugControllerProtocol.h>
#define KEY_DEBUG_WRITE_LOG @"Write Debug Log"
@@ -25,9 +24,7 @@
NSFileHandle *debugLogFile;
}
-+ (ESDebugController *)sharedDebugController;
- (NSFileHandle *)debugLogFile;
- (void)addMessage:(NSString *)actualMessage;
@end
-#endif
diff -r 699c59465ff3 -r becca8ee45f7 Source/ESDebugController.m
--- a/Source/ESDebugController.m Thu Apr 30 20:32:46 2009 -0700
+++ b/Source/ESDebugController.m Sat May 02 15:51:45 2009 -0400
@@ -13,8 +13,6 @@
* You should have received a copy of the GNU General Public License along with this program; if not,
* write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-#ifdef DEBUG_BUILD
-
#import "ESDebugController.h"
#import "ESDebugWindowController.h"
@@ -31,10 +29,12 @@
#define CACHED_DEBUG_LOGS 100 //Number of logs to keep at any given time
#define KEY_DEBUG_WINDOW_OPEN @"Debug Window Open"
+ at interface ESDebugController()
+- (void) start:(NSNotification *)dummy;
+ at end
+
@implementation ESDebugController
-static ESDebugController *sharedDebugController = nil;
-
//Throwing an exception isn't enough, we need to die completely.
void AIExplodeOnEnumerationMutation(id dummy) {
NSLog(@"Attempted to mutate collection %@ of class %@ while enumerating", dummy, [dummy class]);
@@ -43,33 +43,37 @@
- (id)init
{
- if (sharedDebugController)
- self = sharedDebugController;
- else {
- if ((self = [super init])) {
- objc_setEnumerationMutationHandler(AIExplodeOnEnumerationMutation);
+ if ((self = [super init])) {
+#ifdef DEBUG_BUILD
+ objc_setEnumerationMutationHandler(AIExplodeOnEnumerationMutation);
+#endif
- sharedDebugController = self;
-
- debugLogArray = [[NSMutableArray alloc] init];
- }
+ debugLogArray = [[NSMutableArray alloc] init];
}
return self;
}
- (void)controllerDidLoad
{
- //Contact list menu tem
+ if (AIDebugLoggingEnabled) {
+ [self start:nil];
+ } else {
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(start:) name:AIDebugLoggingEnabledNotification object:nil];
+ }
+}
+
+- (void) start:(NSNotification *)dummy {
+ //Contact list menu item
NSMenuItem *menuItem = [[NSMenuItem allocWithZone:[NSMenu menuZone]] initWithTitle:AILocalizedString(@"Debug Window",nil)
target:self
action:@selector(showDebugWindow:)
keyEquivalent:@""];
[adium.menuController addMenuItem:menuItem toLocation:LOC_Adium_About];
[menuItem release];
-
+
//Restore the debug window if it was open when we quit last time
if ([[adium.preferenceController preferenceForKey:KEY_DEBUG_WINDOW_OPEN
- group:GROUP_DEBUG] boolValue]) {
+ group:GROUP_DEBUG] boolValue]) {
[ESDebugWindowController showDebugWindow];
}
@@ -78,6 +82,7 @@
- (void)controllerWillClose
{
+ [[NSNotificationCenter defaultCenter] removeObserver:self];
//Save the open state of the debug window
[adium.preferenceController setPreference:([ESDebugWindowController debugWindowIsOpen] ?
[NSNumber numberWithBool:YES] :
@@ -87,19 +92,12 @@
[ESDebugWindowController closeDebugWindow];
}
-+ (ESDebugController *)sharedDebugController
-{
- return sharedDebugController;
-}
-
- (void)dealloc
{
[debugLogArray release];
[debugLogFile closeFile];
[debugLogFile release];
- sharedDebugController = nil;
-
[super dealloc];
}
@@ -201,5 +199,3 @@
}
@end
-
-#endif
diff -r 699c59465ff3 -r becca8ee45f7 Source/ESDebugWindowController.h
--- a/Source/ESDebugWindowController.h Thu Apr 30 20:32:46 2009 -0700
+++ b/Source/ESDebugWindowController.h Sat May 02 15:51:45 2009 -0400
@@ -29,7 +29,6 @@
NSString *filter;
}
-#ifdef DEBUG_BUILD
+ (id)showDebugWindow;
+ (void)closeDebugWindow;
+ (BOOL)debugWindowIsOpen;
@@ -38,7 +37,5 @@
- (IBAction)clearLog:(id)sender;
- (void)setFilter:(NSString *)inFilter;
-#endif
-
@end
diff -r 699c59465ff3 -r becca8ee45f7 Source/ESDebugWindowController.m
--- a/Source/ESDebugWindowController.m Thu Apr 30 20:32:46 2009 -0700
+++ b/Source/ESDebugWindowController.m Sat May 02 15:51:45 2009 -0400
@@ -22,7 +22,6 @@
#define DEBUG_WINDOW_NIB @"DebugWindow"
@implementation ESDebugWindowController
-#ifdef DEBUG_BUILD
static ESDebugWindowController *sharedDebugWindowInstance = nil;
@@ -177,6 +176,4 @@
}
}
-#endif
-
@end
diff -r 699c59465ff3 -r becca8ee45f7 Utilities/dep-build-scripts/common.sh
--- a/Utilities/dep-build-scripts/common.sh Thu Apr 30 20:32:46 2009 -0700
+++ b/Utilities/dep-build-scripts/common.sh Sat May 02 15:51:45 2009 -0400
@@ -45,13 +45,11 @@
export CC=/usr/bin/gcc-4.2
TARGET_DIR_PPC="$BUILDDIR/root-ppc"
TARGET_DIR_I386="$BUILDDIR/root-i386"
-TARGET_DIR_X86_64="$BUILDDIR/root-x86_64"
TARGET_DIR_ARMV6="$BUILDDIR/root-armv6"
TARGET_DIR_BASE="$BUILDDIR/root"
export PATH_PPC="$TARGET_DIR_PPC/bin:$PATH"
export PATH_I386="$TARGET_DIR_I386/bin:$PATH"
-export PATH_X86_64="$TARGET_DIR_X86_64/root-x86_64:$PATH"
export PATH_ARMV6="$TARGET_DIR_ARMV6/bin:$PATH"
if [ "$1" = "-iphone" ]; then
diff -r 699c59465ff3 -r becca8ee45f7 Utilities/dep-build-scripts/general_dependencies_make.sh
--- a/Utilities/dep-build-scripts/general_dependencies_make.sh Thu Apr 30 20:32:46 2009 -0700
+++ b/Utilities/dep-build-scripts/general_dependencies_make.sh Sat May 02 15:51:45 2009 -0400
@@ -11,13 +11,12 @@
# We only need a native pkg-config, it's not a runtime dependency,
# but we need a native one in both directories
#unset CFLAGS
-for ARCH in ppc i386 x86_64 ; do
+for ARCH in ppc i386 ; do
echo "Building pkg-config for $ARCH"
case $ARCH in
ppc) TARGET_DIR=$TARGET_DIR_PPC;;
i386) TARGET_DIR=$TARGET_DIR_I386;;
- x86_64) TARGET_DIR=$TARGET_DIR_X86_64;;
esac
mkdir pkg-config-`arch` >/dev/null 2>&1 || true
@@ -32,7 +31,7 @@
#gettext
# caveat - some of the build files in gettext appear to not respect CFLAGS
# and are compiling to `arch` instead of $ARCH. Lame.
-for ARCH in ppc i386 x86_64 ; do
+for ARCH in ppc i386 ; do
echo "Building gettext for $ARCH"
export CFLAGS="$BASE_CFLAGS -arch $ARCH"
export CXXFLAGS="$CFLAGS"
@@ -42,9 +41,7 @@
ppc) HOST=powerpc-apple-darwin9
export PATH=$PATH_PPC;;
i386) HOST=i686-apple-darwin9
- export PATH=$PATH_I386;;
- x86_64) HOST=x86_64-apple-darwin9
- export PATH=$PATH_X86_64;;
+ export PATH=$PATH_I386;;
esac
mkdir gettext-$ARCH >/dev/null 2>&1 || true
@@ -72,24 +69,24 @@
# done
# popd > /dev/null 2>&1
-for ARCH in ppc i386 x86_64; do
+for ARCH in ppc i386; do
echo "Building glib for $ARCH"
LOCAL_BIN_DIR="$TARGET_DIR_BASE-$ARCH/bin"
LOCAL_LIB_DIR="$TARGET_DIR_BASE-$ARCH/lib"
LOCAL_INCLUDE_DIR="$TARGET_DIR_BASE-$ARCH/include"
- LOCAL_FLAGS="-L$LOCAL_LIB_DIR -I$LOCAL_INCLUDE_DIR -lintl"
+ LOCAL_FLAGS="-L$LOCAL_LIB_DIR -I$LOCAL_INCLUDE_DIR -lintl -liconv"
export PKG_CONFIG="$LOCAL_BIN_DIR/pkg-config"
export MSGFMT="$LOCAL_BIN_DIR/msgfmt"
- export CFLAGS="$LOCAL_FLAGS $BASE_CFLAGS -arch $ARCH"
+ #Defining USE_LIBICONV_GNU here is a hack to avoid what *appears* to be a mistaken #error in gconvert.c
+ export CFLAGS="$LOCAL_FLAGS $BASE_CFLAGS -arch $ARCH -DUSE_LIBICONV_GNU"
export CPPFLAGS="$CFLAGS"
export LDFLAGS="$LOCAL_FLAGS $BASE_LDFLAGS -arch $ARCH"
case $ARCH in
ppc) HOST=powerpc-apple-darwin9;;
i386) HOST=i686-apple-darwin9;;
- x86_64) HOST=x86_64-apple-darwin9;;
esac
mkdir glib-$ARCH >/dev/null 2>&1 || true
@@ -98,7 +95,7 @@
echo ' Configuring...'
"$SOURCEDIR/$GLIB/configure" \
--prefix=$TARGET_DIR \
- --with-libiconv=native \
+ --with-libiconv \
--disable-static --enable-shared \
--host=$HOST >> $LOG_FILE 2>&1
echo ' make && make install'
diff -r 699c59465ff3 -r becca8ee45f7 Utilities/dep-build-scripts/glibconfig.h
--- a/Utilities/dep-build-scripts/glibconfig.h Thu Apr 30 20:32:46 2009 -0700
+++ b/Utilities/dep-build-scripts/glibconfig.h Sat May 02 15:51:45 2009 -0400
@@ -2,8 +2,6 @@
#include <glibconfig-ppc.h>
#elif defined(__i386__)
#include <glibconfig-i386.h>
-#elif defined(__x86_64__)
-#include <glibconfig-x86_64.h>
#else
#error This isn't a recognized platform.
#endif
diff -r 699c59465ff3 -r becca8ee45f7 Utilities/dep-build-scripts/libgadu.h
--- a/Utilities/dep-build-scripts/libgadu.h Thu Apr 30 20:32:46 2009 -0700
+++ b/Utilities/dep-build-scripts/libgadu.h Sat May 02 15:51:45 2009 -0400
@@ -2,8 +2,6 @@
#include "libgadu-ppc.h"
#elif defined(__i386__)
#include "libgadu-i386.h"
-#elif defined(__x86_64__)
-#include "libgadu-x86_64.h"
#else
#error This isn't a recognized platform.
#endif
diff -r 699c59465ff3 -r becca8ee45f7 Utilities/dep-build-scripts/purple_dependencies_make.sh
--- a/Utilities/dep-build-scripts/purple_dependencies_make.sh Thu Apr 30 20:32:46 2009 -0700
+++ b/Utilities/dep-build-scripts/purple_dependencies_make.sh Sat May 02 15:51:45 2009 -0400
@@ -23,7 +23,7 @@
done
popd > /dev/null 2>&1
-for ARCH in ppc i386 x86_64 ; do
+for ARCH in ppc i386 ; do
echo "Building Meanwhile for $ARCH"
export CFLAGS="$BASE_CFLAGS -arch $ARCH"
@@ -34,11 +34,8 @@
export PATH="$PATH_PPC"
export PKG_CONFIG_PATH="$TARGET_DIR_PPC/lib/pkgconfig";;
i386) TARGET_DIR="$TARGET_DIR_I386"
- export PATH="$PATH_I386"
- export PKG_CONFIG_PATH="$TARGET_DIR_I386/lib/pkgconfig";;
- x86_64) TARGET_DIR="$TARGET_DIR_X86_64"
- export PATH="$PATH_X86_64"
- export PKG_CONFIG_PATH="$TARGET_DIR_X86_64/lib/pkgconfig";;
+ export PATH="$PATH_I386"
+ export PKG_CONFIG_PATH="$TARGET_DIR_I386/lib/pkgconfig";;
esac
mkdir meanwhile-$ARCH || true
@@ -71,7 +68,7 @@
popd > /dev/null 2>&1
# Gadu-gadu
-for ARCH in ppc i386 x86_64 ; do
+for ARCH in ppc i386 ; do
echo "Building Gadu-Gadu for $ARCH"
export CFLAGS="$BASE_CFLAGS -arch $ARCH"
@@ -87,10 +84,6 @@
TARGET_DIR="$TARGET_DIR_I386"
export PATH="$PATH_I386"
export PKG_CONFIG_PATH="$TARGET_DIR_I386/lib/pkgconfig";;
- x86_64) HOST=x86_64-apple-darwin9
- TARGET_DIR="$TARGET_DIR_X86_64"
- export PATH="$PATH_X86_64"
- export PKG_CONFIG_PATH="$TARGET_DIR_X86_64/lib/pkgconfig";;
esac
mkdir gadu-$ARCH || true
@@ -109,7 +102,7 @@
# intltool so pidgin will configure
# need a native intltool in both ppc and i386
-for ARCH in ppc i386 x86_64 ; do
+for ARCH in ppc i386 ; do
echo "Building intltool for $ARCH"
mkdir intltool-$ARCH || true
@@ -118,7 +111,6 @@
case $ARCH in
ppc) TARGET_DIR="$TARGET_DIR_PPC" ;;
i386) TARGET_DIR="$TARGET_DIR_I386" ;;
- x86_64) TARGET_DIR="$TARGET_DIR_X86_64" ;;
esac
echo ' Configuring...'
diff -r 699c59465ff3 -r becca8ee45f7 Utilities/dep-build-scripts/universalize.sh
--- a/Utilities/dep-build-scripts/universalize.sh Thu Apr 30 20:32:46 2009 -0700
+++ b/Utilities/dep-build-scripts/universalize.sh Sat May 02 15:51:45 2009 -0400
@@ -41,8 +41,6 @@
$UNIVERSAL_DIR/include/libglib-2.0.0/glib-2.0/glibconfig-i386.h
cp $TARGET_DIR_PPC/lib/glib-2.0/include/glibconfig.h \
$UNIVERSAL_DIR/include/libglib-2.0.0/glib-2.0/glibconfig-ppc.h
-cp $TARGET_DIR_X86_64/lib/glib-2.0/include/glibconfig.h \
- $UNIVERSAL_DIR/include/libglib-2.0.0/glib-2.0/glibconfig-x86_64.h
cp $SCRIPT_DIR/glibconfig.h $UNIVERSAL_DIR/include/libglib-2.0.0/glib-2.0
mkdir libgmodule-2.0.0 || true
@@ -61,7 +59,6 @@
# Another hack: we need libgadu.h
cp $TARGET_DIR_I386/include/libgadu.h $UNIVERSAL_DIR/include/$PURPLE_FOLDER/libgadu-i386.h
cp $TARGET_DIR_PPC/include/libgadu.h $UNIVERSAL_DIR/include/$PURPLE_FOLDER/libgadu-ppc.h
-cp $TARGET_DIR_X86_64/include/libgadu.h $UNIVERSAL_DIR/include/$PURPLE_FOLDER/libgadu-x86_64.h
cp $SCRIPT_DIR/libgadu.h $UNIVERSAL_DIR/include/$PURPLE_FOLDER/
cd ..
More information about the commits
mailing list