diff options
author | George Hazan <george.hazan@gmail.com> | 2016-09-16 19:43:24 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2016-09-16 19:43:24 +0000 |
commit | 0c41e6c4566fdb2d99b8a6ca1fb48859fd4a0e34 (patch) | |
tree | 700937499ee66952d1ca5b92928fc9ec3b034447 /plugins | |
parent | 7a7a6637021d78ad995f3e21e9743fae69bd2562 (diff) |
- chats services replaces with functions;
- chat calls switched from CallServiceSync to direct calls everywhere
git-svn-id: http://svn.miranda-ng.org/main/trunk@17305 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/Actman/iac_inout.pas | 4 | ||||
-rw-r--r-- | plugins/Dropbox/src/dropbox_utils.cpp | 2 | ||||
-rw-r--r-- | plugins/MirLua/src/m_message.cpp | 2 | ||||
-rw-r--r-- | plugins/MirandaG15/src/CAppletManager.cpp | 2 | ||||
-rw-r--r-- | plugins/PasteIt/src/Options.cpp | 2 | ||||
-rw-r--r-- | plugins/PasteIt/src/PasteIt.cpp | 8 | ||||
-rw-r--r-- | plugins/PasteIt/src/stdafx.h | 2 | ||||
-rw-r--r-- | plugins/Scriver/src/chat/main.cpp | 2 | ||||
-rw-r--r-- | plugins/SendScreenshotPlus/src/CSend.cpp | 6 | ||||
-rw-r--r-- | plugins/SendScreenshotPlus/src/Main.cpp | 2 | ||||
-rw-r--r-- | plugins/SendScreenshotPlus/src/stdafx.h | 2 | ||||
-rw-r--r-- | plugins/TabSRMM/src/chat/main.cpp | 2 | ||||
-rw-r--r-- | plugins/Utils.pas/mircontacts.pas | 45 | ||||
-rw-r--r-- | plugins/XSoundNotify/src/xsn_main.cpp | 3 |
14 files changed, 20 insertions, 64 deletions
diff --git a/plugins/Actman/iac_inout.pas b/plugins/Actman/iac_inout.pas index e83e62ad8f..b8effc62ae 100644 --- a/plugins/Actman/iac_inout.pas +++ b/plugins/Actman/iac_inout.pas @@ -289,9 +289,7 @@ begin dbei.flags :=DBEF_SENT or DBEF_UTF;
db_event_add(hContact, @dbei);
mFreeMem(blob);
- end
- else
- SendToChat(hContact,last);
+ end;
end
else
begin
diff --git a/plugins/Dropbox/src/dropbox_utils.cpp b/plugins/Dropbox/src/dropbox_utils.cpp index c8ef7f06c8..d615b33ea0 100644 --- a/plugins/Dropbox/src/dropbox_utils.cpp +++ b/plugins/Dropbox/src/dropbox_utils.cpp @@ -112,7 +112,7 @@ void CDropbox::SendToContact(MCONTACT hContact, const wchar_t *data) gce.dwFlags = GCEF_ADDTOLOG;
gce.ptszText = mir_wstrdup(data);
gce.time = time(NULL);
- CallServiceSync(MS_GC_EVENT, WINDOW_VISIBLE, (LPARAM)&gce);
+ Chat_Event(WINDOW_VISIBLE, &gce);
mir_free((void*)gce.ptszText);
return;
}
diff --git a/plugins/MirLua/src/m_message.cpp b/plugins/MirLua/src/m_message.cpp index eb99205312..cc0de69657 100644 --- a/plugins/MirLua/src/m_message.cpp +++ b/plugins/MirLua/src/m_message.cpp @@ -42,7 +42,7 @@ static int message_Send(lua_State *L) gce.ptszText = mir_utf8decodeW(message);
gce.time = time(NULL);
- res = CallServiceSync(MS_GC_EVENT, WINDOW_VISIBLE, (LPARAM)&gce);
+ res = Chat_Event(WINDOW_VISIBLE, &gce);
lua_pushinteger(L, res);
mir_free((void*)gce.ptszText);
diff --git a/plugins/MirandaG15/src/CAppletManager.cpp b/plugins/MirandaG15/src/CAppletManager.cpp index 48d2c843c6..f7030c03a8 100644 --- a/plugins/MirandaG15/src/CAppletManager.cpp +++ b/plugins/MirandaG15/src/CAppletManager.cpp @@ -772,7 +772,7 @@ MEVENT CAppletManager::SendMessageToContact(MCONTACT hContact, tstring strMessag gce.ptszText = (LPTSTR)strAscii.c_str(); gce.time = time(NULL); gce.bIsMe = true; - CallService(MS_GC_EVENT, NULL, (LPARAM)&gce); + Chat_Event(NULL, &gce); db_free(&dbv); return 0; diff --git a/plugins/PasteIt/src/Options.cpp b/plugins/PasteIt/src/Options.cpp index 60cec76e47..8d80a15948 100644 --- a/plugins/PasteIt/src/Options.cpp +++ b/plugins/PasteIt/src/Options.cpp @@ -409,7 +409,7 @@ INT_PTR CALLBACK Options::DlgProcOptsPages(HWND hwndDlg, UINT msg, WPARAM wParam }
case WM_CLOSE:
{
- OptsPagesData* optsPagesData = (OptsPagesData*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
+ OptsPagesData *optsPagesData = (OptsPagesData*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
delete optsPagesData;
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, 0);
break;
diff --git a/plugins/PasteIt/src/PasteIt.cpp b/plugins/PasteIt/src/PasteIt.cpp index 6ebee5236d..6b6a8bd599 100644 --- a/plugins/PasteIt/src/PasteIt.cpp +++ b/plugins/PasteIt/src/PasteIt.cpp @@ -54,6 +54,7 @@ PLUGININFOEX pluginInfo = { static IconItem icon = { LPGEN("Paste It"), "PasteIt_main", IDI_MENU };
int hLangpack = 0;
+CHAT_MANAGER *pci;
BOOL APIENTRY DllMain(HMODULE hModule, DWORD, LPVOID)
{
@@ -146,13 +147,13 @@ void PasteIt(MCONTACT hContact, int mode) GC_INFO gci = { 0 };
GCDEST gcd = { szProto, NULL, GC_EVENT_SENDMESSAGE };
GCEVENT gce = { sizeof(gce), &gcd };
- int cnt = (int)CallService(MS_GC_GETSESSIONCOUNT, 0, (LPARAM)szProto);
+ int cnt = pci->SM_GetCount(szProto);
for (int i = 0; i < cnt; i++)
{
gci.iItem = i;
gci.pszModule = szProto;
gci.Flags = GCF_BYINDEX | GCF_HCONTACT | GCF_ID;
- CallService(MS_GC_GETINFO, 0, (LPARAM)&gci);
+ Chat_GetInfo(&gci);
if (gci.hContact == hContact)
{
// In this place session was finded, gci.pszID contains
@@ -163,7 +164,7 @@ void PasteIt(MCONTACT hContact, int mode) gce.dwFlags = GCEF_ADDTOLOG;
gce.ptszText = mir_a2u_cp(pasteToWeb->szFileLink, CP_ACP);
gce.time = time(NULL);
- CallService(MS_GC_EVENT, 0, (LPARAM)&gce);
+ Chat_Event(0, &gce);
mir_free((void*)gce.ptszText);
break;
}
@@ -399,6 +400,7 @@ int ModulesLoaded(WPARAM, LPARAM) extern "C" int __declspec(dllexport) Load(void)
{
mir_getLP(&pluginInfo);
+ pci = Chat_GetInterface();
Icon_Register(hInst, LPGEN("Paste It"), &icon, 1);
diff --git a/plugins/PasteIt/src/stdafx.h b/plugins/PasteIt/src/stdafx.h index 959524e03e..a637e884d0 100644 --- a/plugins/PasteIt/src/stdafx.h +++ b/plugins/PasteIt/src/stdafx.h @@ -27,7 +27,7 @@ #include <m_protosvc.h>
#include <m_options.h>
#include <m_utils.h>
-#include <m_chat.h>
+#include <m_chat_int.h>
#include <m_msg_buttonsbar.h>
diff --git a/plugins/Scriver/src/chat/main.cpp b/plugins/Scriver/src/chat/main.cpp index a223f9898d..cff8723cf0 100644 --- a/plugins/Scriver/src/chat/main.cpp +++ b/plugins/Scriver/src/chat/main.cpp @@ -155,7 +155,7 @@ static void OnLoadSettings() int Chat_Load()
{
CHAT_MANAGER_INITDATA data = { &g_Settings, sizeof(MODULEINFO), sizeof(SESSION_INFO), LPGENW("Messaging") L"/" LPGENW("Group chats"), FONTMODE_SKIP };
- mir_getCI(&data);
+ pci = Chat_GetInterface(&data);
saveCI = *pci;
pci->OnCreateModule = OnCreateModule;
diff --git a/plugins/SendScreenshotPlus/src/CSend.cpp b/plugins/SendScreenshotPlus/src/CSend.cpp index 61e4be2080..d80b7a016b 100644 --- a/plugins/SendScreenshotPlus/src/CSend.cpp +++ b/plugins/SendScreenshotPlus/src/CSend.cpp @@ -222,14 +222,14 @@ void CSend::svcSendMsgExit(const char* szMessage) } GC_INFO gci = { 0 }; int res = GC_RESULT_NOSESSION; - int cnt = (int)CallService(MS_GC_GETSESSIONCOUNT, 0, (LPARAM)m_pszProto); + int cnt = pci->SM_GetCount(m_pszProto); //loop on all gc session to get the right (save) ptszID for the chatroom from m_hContact gci.pszModule = m_pszProto; for (int i = 0; i < cnt; i++) { gci.iItem = i; gci.Flags = GCF_BYINDEX | GCF_HCONTACT | GCF_ID; - CallService(MS_GC_GETINFO, 0, (LPARAM)&gci); + Chat_GetInfo(&gci); if (gci.hContact == m_hContact) { GCDEST gcd = { m_pszProto, gci.pszID, GC_EVENT_SENDMESSAGE }; GCEVENT gce = { sizeof(gce), &gcd }; @@ -239,7 +239,7 @@ void CSend::svcSendMsgExit(const char* szMessage) gce.time = time(NULL); //* returns 0 on success or error code on failure - res = 200 + (int)CallService(MS_GC_EVENT, 0, (LPARAM)&gce); + res = 200 + (int)Chat_Event(0, &gce); break; } } diff --git a/plugins/SendScreenshotPlus/src/Main.cpp b/plugins/SendScreenshotPlus/src/Main.cpp index 6866930af5..7026c4c832 100644 --- a/plugins/SendScreenshotPlus/src/Main.cpp +++ b/plugins/SendScreenshotPlus/src/Main.cpp @@ -30,6 +30,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "Main.h" // Prototypes /////////////////////////////////////////////////////////////////////////// +CHAT_MANAGER *pci;
CLIST_INTERFACE *pcli; HINSTANCE g_hSendSS; MGLOBAL g_myGlobals; @@ -258,6 +259,7 @@ ATOM g_clsTargetHighlighter = 0; DLL_EXPORT int Load(void) { mir_getLP(&pluginInfo); + pci = Chat_GetInterface();
pcli = Clist_GetInterface(); INT_PTR result = CallService(MS_IMG_GETINTERFACE, FI_IF_VERSION, (LPARAM)&FIP); diff --git a/plugins/SendScreenshotPlus/src/stdafx.h b/plugins/SendScreenshotPlus/src/stdafx.h index 5a079657bf..a96f88f4d1 100644 --- a/plugins/SendScreenshotPlus/src/stdafx.h +++ b/plugins/SendScreenshotPlus/src/stdafx.h @@ -53,7 +53,7 @@ using namespace std; #include <msapi/vssym32.h> #include <newpluginapi.h> #include <m_button.h> -#include <m_chat.h> +#include <m_chat_int.h> #include <m_clist.h> #include <m_contacts.h> #include <m_database.h> diff --git a/plugins/TabSRMM/src/chat/main.cpp b/plugins/TabSRMM/src/chat/main.cpp index d1f8cb16e0..e3005afb9f 100644 --- a/plugins/TabSRMM/src/chat/main.cpp +++ b/plugins/TabSRMM/src/chat/main.cpp @@ -265,7 +265,7 @@ int Chat_Load() CheckUpdate();
CHAT_MANAGER_INITDATA data = { &g_Settings, sizeof(MODULEINFO), sizeof(SESSION_INFO), LPGENW("Message Sessions") L"/" LPGENW("Group chats"), FONTMODE_ALTER };
- mir_getCI(&data);
+ pci = Chat_GetInterface(&data);
saveCI = *pci;
pci->OnCreateModule = OnCreateModule;
pci->OnNewUser = OnNewUser;
diff --git a/plugins/Utils.pas/mircontacts.pas b/plugins/Utils.pas/mircontacts.pas index d9e2e2bf7e..7e5337c8c8 100644 --- a/plugins/Utils.pas/mircontacts.pas +++ b/plugins/Utils.pas/mircontacts.pas @@ -45,7 +45,6 @@ function WndToContact(wnd:HWND):TMCONTACT; overload; function WndToContact:TMCONTACT; overload;
procedure ShowContactDialog(hContact:TMCONTACT;DblClk:boolean=true;anystatus:boolean=true);
-procedure SendToChat(hContact:TMCONTACT;pszText:PWideChar);
//----- List of contacts (combobox) -----
@@ -486,50 +485,6 @@ CallService(MS_CLIST_CONTACTDOUBLECLICKED,hContact,0); end;
end;
-procedure SendChatText(pszID:pointer;pszModule:PAnsiChar;pszText:pointer);
-var
- gcd:TGCDEST;
- gce:TGCEVENT;
-begin
- gcd.pszModule:=pszModule;
- gcd.iType :=GC_EVENT_SENDMESSAGE;
- gcd.szID.w :=pszID;
-
- FillChar(gce,SizeOf(TGCEVENT),0);
- gce.cbSize :=SizeOf(TGCEVENT);
- gce.pDest :=@gcd;
- gce.bIsMe :=true;
- gce.szText.w:=pszText;
- gce.dwFlags :=GCEF_ADDTOLOG;
- gce.time :=GetCurrentTimeStamp;
-
- CallServiceSync(MS_GC_EVENT,0,lparam(@gce));
-end;
-
-procedure SendToChat(hContact:TMCONTACT;pszText:PWideChar);
-var
- gci:TGC_INFO;
- pszModule:PAnsiChar;
- i,cnt:integer;
-begin
- pszModule:=GetContactProto(hContact);
- cnt:=CallService(MS_GC_GETSESSIONCOUNT,0,lparam(pszModule));
- i:=0;
- gci.pszModule:=pszModule;
- while i<cnt do
- begin
- gci.iItem:=i;
- gci.Flags:=GCF_BYINDEX+GCF_HCONTACT+GCF_ID;
- CallService(MS_GC_GETINFO,0,lparam(@gci));
- if gci.hContact=hContact then
- begin
- SendChatText(gci.pszID.w,pszModule,pszText);
- break;
- end;
- inc(i);
- end;
-end;
-
//----- List of contacts -----
const
diff --git a/plugins/XSoundNotify/src/xsn_main.cpp b/plugins/XSoundNotify/src/xsn_main.cpp index b55359a816..25ba83707b 100644 --- a/plugins/XSoundNotify/src/xsn_main.cpp +++ b/plugins/XSoundNotify/src/xsn_main.cpp @@ -175,8 +175,6 @@ static int OnPlaySound(WPARAM, LPARAM) static int OnLoadInit(WPARAM, LPARAM)
{
- mir_getCI(NULL);
-
CMenuItem mi;
SET_UID(mi, 0x5d72ca1f, 0xc52, 0x436d, 0x81, 0x47, 0x29, 0xf6, 0xc3, 0x28, 0xb5, 0xd1);
mi.position = -0x7FFFFFFF;
@@ -210,6 +208,7 @@ static int OnPreShutdown(WPARAM, LPARAM) extern "C" int __declspec(dllexport) Load()
{
mir_getLP(&pluginInfo);
+ pci = Chat_GetInterface();
pcli = Clist_GetInterface();
CreateServiceFunction("XSoundNotify/ContactMenuCommand", ShowDialog);
|