From 0c41e6c4566fdb2d99b8a6ca1fb48859fd4a0e34 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 16 Sep 2016 19:43:24 +0000 Subject: - 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 --- protocols/Tox/src/stdafx.h | 2 +- protocols/Tox/src/tox.cpp | 4 +++- protocols/Tox/src/tox_chatrooms.cpp | 10 +++++----- 3 files changed, 9 insertions(+), 7 deletions(-) (limited to 'protocols/Tox/src') diff --git a/protocols/Tox/src/stdafx.h b/protocols/Tox/src/stdafx.h index 9f37777cc5..e4f9c6987b 100644 --- a/protocols/Tox/src/stdafx.h +++ b/protocols/Tox/src/stdafx.h @@ -34,7 +34,7 @@ DEFINE_PROPERTYKEY(PKEY_Device_FriendlyName, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0 #include #include #include -#include +#include #include #include #include diff --git a/protocols/Tox/src/tox.cpp b/protocols/Tox/src/tox.cpp index 10c30c14ee..0ee2774aa4 100644 --- a/protocols/Tox/src/tox.cpp +++ b/protocols/Tox/src/tox.cpp @@ -1,7 +1,8 @@ #include "stdafx.h" int hLangpack; -CLIST_INTERFACE* pcli; +CHAT_MANAGER *pci; +CLIST_INTERFACE *pcli; HINSTANCE g_hInstance; HMODULE g_hToxLibrary = NULL; @@ -40,6 +41,7 @@ extern "C" int __declspec(dllexport) Load(void) if (g_hToxLibrary == NULL) return 0; + pci = Chat_GetInterface(); pcli = Clist_GetInterface(); mir_getLP(&pluginInfo); diff --git a/protocols/Tox/src/tox_chatrooms.cpp b/protocols/Tox/src/tox_chatrooms.cpp index 82805ab96e..2cf2641db8 100644 --- a/protocols/Tox/src/tox_chatrooms.cpp +++ b/protocols/Tox/src/tox_chatrooms.cpp @@ -140,7 +140,7 @@ void CToxProto::InitGroupChatModule() gcr.iMaxText = 0; gcr.ptszDispName = this->m_tszUserName; gcr.pszModule = this->m_szModuleName; - CallServiceSync(MS_GC_REGISTER, 0, (LPARAM)&gcr); + Chat_Register(&gcr); HookProtoEvent(ME_GC_EVENT, &CToxProto::OnGroupChatEventHook); HookProtoEvent(ME_GC_BUILDMENU, &CToxProto::OnGroupChatMenuHook); @@ -155,16 +155,16 @@ void CToxProto::CloseAllChatChatSessions() gci.Flags = GCF_BYINDEX | GCF_ID | GCF_DATA; gci.pszModule = m_szModuleName; - int count = CallServiceSync(MS_GC_GETSESSIONCOUNT, 0, (LPARAM)m_szModuleName); + int count = pci->SM_GetCount(m_szModuleName); for (int i = 0; i < count; i++) { gci.iItem = i; - if (!CallServiceSync(MS_GC_GETINFO, 0, (LPARAM)&gci)) + if (!Chat_GetInfo(&gci)) { GCDEST gcd = { m_szModuleName, gci.pszID, GC_EVENT_CONTROL }; GCEVENT gce = { sizeof(gce), &gcd }; - CallServiceSync(MS_GC_EVENT, SESSION_OFFLINE, (LPARAM)&gce); - CallServiceSync(MS_GC_EVENT, SESSION_TERMINATE, (LPARAM)&gce); + Chat_Event(SESSION_OFFLINE, &gce); + Chat_Event(SESSION_TERMINATE, &gce); } } } -- cgit v1.2.3