diff --git a/src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs b/src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs index 72660ec28..64b38127e 100644 --- a/src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs +++ b/src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs @@ -115,6 +115,12 @@ protected bool HasTokens { } } + public override bool HiddenPresenceStatus { + get { + return true; + } + } + public TwitterProtocolManager(Session session) : base(session) { Trace.Call(session); diff --git a/src/Engine/Protocols/IProtocolManager.cs b/src/Engine/Protocols/IProtocolManager.cs index 35ff6c93c..0722db254 100644 --- a/src/Engine/Protocols/IProtocolManager.cs +++ b/src/Engine/Protocols/IProtocolManager.cs @@ -67,6 +67,10 @@ PresenceStatus PresenceStatus { get; } + bool HiddenPresenceStatus { + get; + } + void Connect(FrontendManager frontendManager, ServerModel server); void Disconnect(FrontendManager frontendManager); void Reconnect(FrontendManager frontendManager); diff --git a/src/Engine/Protocols/ProtocolManagerBase.cs b/src/Engine/Protocols/ProtocolManagerBase.cs index 3b6e1ca06..5b7dc7dc6 100644 --- a/src/Engine/Protocols/ProtocolManagerBase.cs +++ b/src/Engine/Protocols/ProtocolManagerBase.cs @@ -86,6 +86,12 @@ public virtual PresenceStatus PresenceStatus { } } + public virtual bool HiddenPresenceStatus { + get { + return false; + } + } + public abstract string NetworkID { get; } diff --git a/src/Frontend-GNOME/Views/Chats/ProtocolChatView.cs b/src/Frontend-GNOME/Views/Chats/ProtocolChatView.cs index 4fb9844d9..5a5b50ac7 100644 --- a/src/Frontend-GNOME/Views/Chats/ProtocolChatView.cs +++ b/src/Frontend-GNOME/Views/Chats/ProtocolChatView.cs @@ -168,7 +168,7 @@ public override void Close() ownedChats++; } } - if (ownedChats > 1) { + if (!ProtocolManager.HiddenPresenceStatus && ownedChats > 1) { Gtk.MessageDialog md = new Gtk.MessageDialog( Frontend.MainWindow, Gtk.DialogFlags.Modal, diff --git a/src/Frontend-Tests/Mocks/MockProtocolManager.cs b/src/Frontend-Tests/Mocks/MockProtocolManager.cs index cf7ec8342..df3908e90 100644 --- a/src/Frontend-Tests/Mocks/MockProtocolManager.cs +++ b/src/Frontend-Tests/Mocks/MockProtocolManager.cs @@ -35,6 +35,12 @@ public Session Session { } } + public bool HiddenPresenceStatus { + get { + return false; + } + } + public string NetworkID { get { return "MockProtocolManagerNetwork"; diff --git a/src/Frontend/ChatViewSyncManager.cs b/src/Frontend/ChatViewSyncManager.cs index 7a726b47d..cd57e08dc 100644 --- a/src/Frontend/ChatViewSyncManager.cs +++ b/src/Frontend/ChatViewSyncManager.cs @@ -79,8 +79,8 @@ public void Add(ChatModel chatModel) Math.Round(duration) + " ms"); #endif - OnChatAdded(chatModel, chatId, chatType, chatPosition, - protocolManager, protocolManagerType); + RaiseChatAdded(chatModel, chatId, chatType, chatPosition, + protocolManager, protocolManagerType); } /// @@ -290,10 +290,10 @@ void SyncWorker(ChatModel chatModel) } } - void OnChatAdded(ChatModel chatModel, string chatId, - ChatType chatType, int chatPosition, - IProtocolManager protocolManager, - Type protocolManagerType) + void RaiseChatAdded(ChatModel chatModel, string chatId, + ChatType chatType, int chatPosition, + IProtocolManager protocolManager, + Type protocolManagerType) { if (ChatAdded != null) { ChatAdded(this,