summaryrefslogtreecommitdiff
path: root/plugins/Scriver/src/chat/main.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2014-01-18 12:41:41 +0000
committerGeorge Hazan <george.hazan@gmail.com>2014-01-18 12:41:41 +0000
commit00a9149e272b38b002d2a2711c54fab25bcf733f (patch)
treee30540b4a917c55fd0cb42dd2829e7308412ffac /plugins/Scriver/src/chat/main.cpp
parentd4bff57e724e532ef2382137c0c4f6fd59f1a9b3 (diff)
- log writing fixed;
- DoPopup & DoTrayIcons now use inheritance; - massive cleaning git-svn-id: http://svn.miranda-ng.org/main/trunk@7716 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Scriver/src/chat/main.cpp')
-rw-r--r--plugins/Scriver/src/chat/main.cpp22
1 files changed, 21 insertions, 1 deletions
diff --git a/plugins/Scriver/src/chat/main.cpp b/plugins/Scriver/src/chat/main.cpp
index b8d2dbc0b4..6e991c12d9 100644
--- a/plugins/Scriver/src/chat/main.cpp
+++ b/plugins/Scriver/src/chat/main.cpp
@@ -22,7 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "../commonheaders.h"
// globals
-CHAT_MANAGER *pci;
+CHAT_MANAGER *pci, saveCI;
HMENU g_hMenu = NULL;
GlobalLogSettings g_Settings;
@@ -116,6 +116,20 @@ static void OnCreateModule(MODULEINFO *mi)
mi->hOfflineIconBig = LoadSkinnedProtoIconBig(mi->pszModule, ID_STATUS_OFFLINE);
}
+static BOOL DoTrayIcon(SESSION_INFO *si, GCEVENT *gce)
+{
+ if (gce->pDest->iType & g_Settings.dwTrayIconFlags)
+ return saveCI.DoTrayIcon(si, gce);
+ return TRUE;
+}
+
+static BOOL DoPopup(SESSION_INFO *si, GCEVENT *gce)
+{
+ if (gce->pDest->iType & g_Settings.dwPopupFlags)
+ return saveCI.DoPopup(si, gce);
+ return TRUE;
+}
+
static void RegisterFonts()
{
ColourIDT colourid = { sizeof(colourid) };
@@ -148,6 +162,8 @@ int Chat_Load()
{
CHAT_MANAGER_INITDATA data = { &g_Settings, sizeof(MODULEINFO), sizeof(SESSION_INFO), LPGENT("Messaging")_T("/")LPGENT("Group chats") };
mir_getCI(&data);
+ saveCI = *pci;
+
pci->OnCreateModule = OnCreateModule;
pci->OnNewUser = OnNewUser;
@@ -164,6 +180,9 @@ int Chat_Load()
pci->OnSetStatusBar = OnSetStatusBar;
pci->OnFlashWindow = OnFlashWindow;
pci->ShowRoom = ShowRoom;
+
+ pci->DoPopup = DoPopup;
+ pci->DoTrayIcon = DoTrayIcon;
pci->ReloadSettings();
g_hMenu = LoadMenu(g_hInst, MAKEINTRESOURCE(IDR_MENU));
@@ -176,6 +195,7 @@ int Chat_Unload(void)
db_set_w(NULL, "Chat", "SplitterX", (WORD)g_Settings.iSplitterX);
DestroyMenu(g_hMenu);
+ *pci = saveCI;
return 0;
}