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/SkypeWeb/src/main.cpp | 2 +- protocols/SkypeWeb/src/skype_chatrooms.cpp | 38 +++++++++++++++--------------- protocols/SkypeWeb/src/skype_contacts.cpp | 2 +- 3 files changed, 21 insertions(+), 21 deletions(-) (limited to 'protocols/SkypeWeb') diff --git a/protocols/SkypeWeb/src/main.cpp b/protocols/SkypeWeb/src/main.cpp index 3e5f56b471..6c4965b96b 100644 --- a/protocols/SkypeWeb/src/main.cpp +++ b/protocols/SkypeWeb/src/main.cpp @@ -58,7 +58,7 @@ extern "C" int __declspec(dllexport) Load(void) { mir_getLP(&pluginInfo); pcli = Clist_GetInterface(); - mir_getCI(nullptr); + pci = Chat_GetInterface(); CallService(MS_IMG_GETINTERFACE, FI_IF_VERSION, (LPARAM)&fii); CallService(MS_SYSTEM_GETVERSIONTEXT, sizeof(g_szMirVer), LPARAM(g_szMirVer)); diff --git a/protocols/SkypeWeb/src/skype_chatrooms.cpp b/protocols/SkypeWeb/src/skype_chatrooms.cpp index 3f1ce32b1d..107dc2bbcd 100644 --- a/protocols/SkypeWeb/src/skype_chatrooms.cpp +++ b/protocols/SkypeWeb/src/skype_chatrooms.cpp @@ -23,7 +23,7 @@ void CSkypeProto::InitGroupChatModule() gcr.iMaxText = 0; gcr.ptszDispName = m_tszUserName; gcr.pszModule = m_szModuleName; - CallServiceSync(MS_GC_REGISTER, 0, (LPARAM)&gcr); + Chat_Register(&gcr); HookProtoEvent(ME_GC_EVENT, &CSkypeProto::OnGroupChatEventHook); HookProtoEvent(ME_GC_BUILDMENU, &CSkypeProto::OnGroupChatMenuHook); @@ -42,12 +42,12 @@ void CSkypeProto::CloseAllChatChatSessions() 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); } } } @@ -66,7 +66,7 @@ void CSkypeProto::StartChatRoom(const wchar_t *tid, const wchar_t *tname) gcw.ptszID = tid; gcw.pszModule = m_szModuleName; gcw.ptszName = tname; - CallServiceSync(MS_GC_NEWSESSION, 0, (LPARAM)&gcw); + Chat_NewSession(&gcw); // Send setting events GCDEST gcd = { m_szModuleName, tid, GC_EVENT_ADDGROUP }; @@ -74,9 +74,9 @@ void CSkypeProto::StartChatRoom(const wchar_t *tid, const wchar_t *tname) // Create a user statuses gce.ptszStatus = TranslateT("Admin"); - CallServiceSync(MS_GC_EVENT, NULL, reinterpret_cast(&gce)); + Chat_Event(NULL, &gce); gce.ptszStatus = TranslateT("User"); - CallServiceSync(MS_GC_EVENT, NULL, reinterpret_cast(&gce)); + Chat_Event(NULL, &gce); // Finish initialization gcd.iType = GC_EVENT_CONTROL; @@ -85,8 +85,8 @@ void CSkypeProto::StartChatRoom(const wchar_t *tid, const wchar_t *tname) bool hideChats = getBool("HideChats", 1); - CallServiceSync(MS_GC_EVENT, (hideChats ? WINDOW_HIDDEN : SESSION_INITDONE), reinterpret_cast(&gce)); - CallServiceSync(MS_GC_EVENT, SESSION_ONLINE, reinterpret_cast(&gce)); + Chat_Event((hideChats ? WINDOW_HIDDEN : SESSION_INITDONE), &gce); + Chat_Event(SESSION_ONLINE, &gce); } void CSkypeProto::OnLoadChats(const NETLIBHTTPREQUEST *response) @@ -247,7 +247,7 @@ int CSkypeProto::OnGroupChatEventHook(WPARAM, LPARAM lParam) gce.ptszText = tnick_new; gce.dwFlags = GCEF_ADDTOLOG; gce.time = time(NULL); - CallServiceSync(MS_GC_EVENT, 0, (LPARAM)&gce); + Chat_Event(0, &gce); if (!reset) db_set_ws(hChatContact, "UsersNicks", _T2A(gch->ptszUID), tnick_new); @@ -288,8 +288,8 @@ INT_PTR CSkypeProto::OnLeaveChatRoom(WPARAM hContact, LPARAM) GCEVENT gce = { sizeof(gce), &gcd }; gce.time = ::time(NULL); - CallServiceSync(MS_GC_EVENT, SESSION_OFFLINE, reinterpret_cast(&gce)); - CallServiceSync(MS_GC_EVENT, SESSION_TERMINATE, reinterpret_cast(&gce)); + Chat_Event(SESSION_OFFLINE, &gce); + Chat_Event(SESSION_TERMINATE, &gce); SendRequest(new KickUserRequest(_T2A(idT), li.szSkypename, li)); @@ -422,7 +422,7 @@ void CSkypeProto::OnChatEvent(const JSONNode &node) gce.time = time(NULL); gce.bIsMe = IsMe(id); gce.ptszStatus = TranslateT("Admin"); - CallServiceSync(MS_GC_EVENT, 0, (LPARAM)&gce); + Chat_Event(0, &gce); } } } @@ -484,7 +484,7 @@ void CSkypeProto::AddMessageToChat(const wchar_t *chat_id, const wchar_t *from, if (isLoading) gce.dwFlags = GCEF_NOTNOTIFY; - CallServiceSync(MS_GC_EVENT, 0, (LPARAM)&gce); + Chat_Event(0, &gce); } void CSkypeProto::OnGetChatInfo(const NETLIBHTTPREQUEST *response, void *p) @@ -524,7 +524,7 @@ void CSkypeProto::RenameChat(const char *chat_id, const char *name) GCDEST gcd = { m_szModuleName, tchat_id, GC_EVENT_CHANGESESSIONAME }; GCEVENT gce = { sizeof(gce), &gcd }; gce.ptszText = tname; - CallService(MS_GC_EVENT, 0, reinterpret_cast(&gce)); + Chat_Event(0, &gce); } void CSkypeProto::ChangeChatTopic(const char *chat_id, const char *topic, const char *initiator) @@ -538,7 +538,7 @@ void CSkypeProto::ChangeChatTopic(const char *chat_id, const char *topic, const gce.ptszUID = tname; gce.ptszNick = tname; gce.ptszText = ttopic; - CallService(MS_GC_EVENT, 0, reinterpret_cast(&gce)); + Chat_Event(0, &gce); } bool CSkypeProto::IsChatContact(const wchar_t *chat_id, const char *id) @@ -553,7 +553,7 @@ char *CSkypeProto::GetChatUsers(const wchar_t *chat_id) gci.Flags = GCF_USERS; gci.pszModule = m_szModuleName; gci.pszID = chat_id; - CallService(MS_GC_GETINFO, 0, (LPARAM)&gci); + Chat_GetInfo(&gci); return gci.pszUsers; } @@ -610,7 +610,7 @@ void CSkypeProto::AddChatContact(const wchar_t *tchat_id, const char *id, const gce.bIsMe = IsMe(id); gce.ptszStatus = TranslateW(role); - CallServiceSync(MS_GC_EVENT, 0, reinterpret_cast(&gce)); + Chat_Event(0, &gce); } void CSkypeProto::RemoveChatContact(const wchar_t *tchat_id, const char *id, const char *name, bool isKick, const char *initiator) @@ -640,7 +640,7 @@ void CSkypeProto::RemoveChatContact(const wchar_t *tchat_id, const char *id, con gce.bIsMe = IsMe(id); } - CallServiceSync(MS_GC_EVENT, 0, reinterpret_cast(&gce)); + Chat_Event(0, &gce); } INT_PTR CSkypeProto::SvcCreateChat(WPARAM, LPARAM) diff --git a/protocols/SkypeWeb/src/skype_contacts.cpp b/protocols/SkypeWeb/src/skype_contacts.cpp index acabbd7b7a..73a0d91c09 100644 --- a/protocols/SkypeWeb/src/skype_contacts.cpp +++ b/protocols/SkypeWeb/src/skype_contacts.cpp @@ -51,7 +51,7 @@ void CSkypeProto::SetChatStatus(MCONTACT hContact, int iStatus) return; GCDEST gcd = { m_szModuleName, tszChatID, GC_EVENT_CONTROL }; GCEVENT gce = { sizeof(gce), &gcd }; - CallServiceSync(MS_GC_EVENT, (iStatus == ID_STATUS_OFFLINE) ? SESSION_OFFLINE : SESSION_ONLINE, (LPARAM)&gce); + Chat_Event((iStatus == ID_STATUS_OFFLINE) ? SESSION_OFFLINE : SESSION_ONLINE, &gce); } MCONTACT CSkypeProto::GetContactFromAuthEvent(MEVENT hEvent) -- cgit v1.2.3