diff options
author | Matt A. Tobin <email@mattatobin.com> | 2019-11-12 21:31:48 -0500 |
---|---|---|
committer | Matt A. Tobin <email@mattatobin.com> | 2019-11-12 21:31:48 -0500 |
commit | cc757e4e459a68bd21fa68312520ac40a5840448 (patch) | |
tree | aa4e3499f658a4b6f50176a42b7a5001f9586b37 /mailnews/base/src/nsMessengerOSXIntegration.mm | |
parent | 73cdfdcf32a2bbd594e26281a0cd427c7c15fa86 (diff) | |
download | UXP-cc757e4e459a68bd21fa68312520ac40a5840448.tar UXP-cc757e4e459a68bd21fa68312520ac40a5840448.tar.gz UXP-cc757e4e459a68bd21fa68312520ac40a5840448.tar.lz UXP-cc757e4e459a68bd21fa68312520ac40a5840448.tar.xz UXP-cc757e4e459a68bd21fa68312520ac40a5840448.zip |
Issue #1258 - Part 10: Remove chat core bits
Diffstat (limited to 'mailnews/base/src/nsMessengerOSXIntegration.mm')
-rw-r--r-- | mailnews/base/src/nsMessengerOSXIntegration.mm | 24 |
1 files changed, 1 insertions, 23 deletions
diff --git a/mailnews/base/src/nsMessengerOSXIntegration.mm b/mailnews/base/src/nsMessengerOSXIntegration.mm index 286c76044..280bdf433 100644 --- a/mailnews/base/src/nsMessengerOSXIntegration.mm +++ b/mailnews/base/src/nsMessengerOSXIntegration.mm @@ -51,11 +51,8 @@ #include <Carbon/Carbon.h> #import <Cocoa/Cocoa.h> -#define kChatEnabledPref "mail.chat.enabled" #define kBiffAnimateDockIconPref "mail.biff.animate_dock_icon" #define kMaxDisplayCount 10 -#define kNewChatMessageTopic "new-directed-incoming-message" -#define kUnreadImCountChangedTopic "unread-im-count-changed" using namespace mozilla::mailnews; @@ -162,7 +159,6 @@ nsMessengerOSXIntegration::nsMessengerOSXIntegration() mBiffStateAtom = MsgGetAtom("BiffState"); mNewMailReceivedAtom = MsgGetAtom("NewMailReceived"); mUnreadTotal = 0; - mUnreadChat = 0; } nsMessengerOSXIntegration::~nsMessengerOSXIntegration() @@ -231,14 +227,7 @@ nsMessengerOSXIntegration::Observe(nsISupports* aSubject, const char* aTopic, co if (NS_SUCCEEDED(rv)) { observerService->RemoveObserver(this, "mail-startup-done"); - bool chatEnabled = false; nsCOMPtr<nsIPrefBranch> pref(do_GetService(NS_PREFSERVICE_CONTRACTID, &rv)); - if (NS_SUCCEEDED(rv)) - rv = pref->GetBoolPref(kChatEnabledPref, &chatEnabled); - if (NS_SUCCEEDED(rv) && chatEnabled) { - observerService->AddObserver(this, kNewChatMessageTopic, false); - observerService->AddObserver(this, kUnreadImCountChangedTopic, false); - } } // Register with the new mail service for changes to the unread message count @@ -260,22 +249,11 @@ nsMessengerOSXIntegration::Observe(nsISupports* aSubject, const char* aTopic, co return mailSession->AddFolderListener(this, nsIFolderListener::boolPropertyChanged | nsIFolderListener::intPropertyChanged); } - if (!strcmp(aTopic, kNewChatMessageTopic)) { - // We don't have to bother about checking if the window is already focused - // before attempting to bounce the dock icon, as BounceDockIcon is - // implemented by a getAttention call which won't do anything if the window - // requesting attention is already focused. - return BounceDockIcon(); - } - if (!strcmp(aTopic, kUnreadImCountChangedTopic)) { nsresult rv; nsCOMPtr<nsISupportsPRInt32> unreadCount = do_QueryInterface(aSubject, &rv); NS_ENSURE_SUCCESS(rv, rv); - rv = unreadCount->GetData(&mUnreadChat); - NS_ENSURE_SUCCESS(rv, rv); - return BadgeDockIcon(); } @@ -515,7 +493,7 @@ nsMessengerOSXIntegration::BadgeDockIcon() { NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT; - int32_t unreadCount = mUnreadTotal + mUnreadChat; + int32_t unreadCount = mUnreadTotal; // If count is less than one, we should restore the original dock icon. if (unreadCount < 1) { |