summaryrefslogtreecommitdiff
path: root/src/mir_app
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2016-09-17 08:15:59 +0000
committerGeorge Hazan <george.hazan@gmail.com>2016-09-17 08:15:59 +0000
commit7057588689d25144fc5e5930d95451bf0791b3ab (patch)
tree47af0bce87688ad60d5c45b4fb616004546f2baa /src/mir_app
parent0c41e6c4566fdb2d99b8a6ca1fb48859fd4a0e34 (diff)
crutch for window creation
git-svn-id: http://svn.miranda-ng.org/main/trunk@17306 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/mir_app')
-rw-r--r--src/mir_app/src/chat_svc.cpp33
1 files changed, 31 insertions, 2 deletions
diff --git a/src/mir_app/src/chat_svc.cpp b/src/mir_app/src/chat_svc.cpp
index 0e390c90e4..c5acd9abb6 100644
--- a/src/mir_app/src/chat_svc.cpp
+++ b/src/mir_app/src/chat_svc.cpp
@@ -119,6 +119,9 @@ static int SmileyOptionsChanged(WPARAM, LPARAM)
return 0;
}
+/////////////////////////////////////////////////////////////////////////////////////////
+// retrieveing chat info
+
EXTERN_C MIR_APP_DLL(int) Chat_GetInfo(GC_INFO *gci)
{
if (!gci || !gci->pszModule)
@@ -144,6 +147,9 @@ EXTERN_C MIR_APP_DLL(int) Chat_GetInfo(GC_INFO *gci)
return 0;
}
+/////////////////////////////////////////////////////////////////////////////////////////
+// registers protocol as chat provider
+
MIR_APP_DLL(int) Chat_Register(const GCREGISTER *gcr)
{
if (gcr == NULL)
@@ -181,6 +187,9 @@ MIR_APP_DLL(int) Chat_Register(const GCREGISTER *gcr)
return 0;
}
+/////////////////////////////////////////////////////////////////////////////////////////
+// starts new chat session
+
EXTERN_C MIR_APP_DLL(int) Chat_NewSession(const GCSESSION *gcw)
{
if (gcw == NULL)
@@ -254,6 +263,26 @@ EXTERN_C MIR_APP_DLL(int) Chat_NewSession(const GCSESSION *gcw)
return 0;
}
+/////////////////////////////////////////////////////////////////////////////////////////
+// handles chat event
+
+struct ShowChatParam
+{
+ ShowChatParam(SESSION_INFO *_si, int _command, int _bShow) :
+ si(_si), command(_command), bShow(_bShow)
+ {}
+
+ SESSION_INFO *si;
+ int command, bShow;
+};
+
+static void __stdcall stubShowRoom(void *param)
+{
+ ShowChatParam *p = (ShowChatParam*)param;
+ chatApi.ShowRoom(p->si, p->command, p->bShow);
+ delete p;
+}
+
static void SetInitDone(SESSION_INFO *si)
{
if (si->bInitDone)
@@ -276,7 +305,7 @@ static int DoControl(GCEVENT *gce, WPARAM wp)
SetInitDone(si);
chatApi.SetActiveSession(si->ptszID, si->pszModule);
if (si->hWnd)
- chatApi.ShowRoom(si, wp, FALSE);
+ CallFunctionAsync(stubShowRoom, new ShowChatParam(si, wp, FALSE));
}
return 0;
@@ -287,7 +316,7 @@ static int DoControl(GCEVENT *gce, WPARAM wp)
if (si = chatApi.SM_FindSession(gce->pDest->ptszID, gce->pDest->pszModule)) {
SetInitDone(si);
if (wp != SESSION_INITDONE || db_get_b(NULL, CHAT_MODULE, "PopupOnJoin", 0) == 0)
- chatApi.ShowRoom(si, wp, TRUE);
+ CallFunctionAsync(stubShowRoom, new ShowChatParam(si, wp, TRUE));
return 0;
}
break;