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/MSN/src/msn_chat.cpp | 26 +++++++++++++------------- protocols/MSN/src/msn_commands.cpp | 10 +++++----- protocols/MSN/src/msn_misc.cpp | 2 +- protocols/MSN/src/msn_proto.cpp | 2 +- 4 files changed, 20 insertions(+), 20 deletions(-) (limited to 'protocols/MSN/src') diff --git a/protocols/MSN/src/msn_chat.cpp b/protocols/MSN/src/msn_chat.cpp index abdeac5334..386ea11a5f 100644 --- a/protocols/MSN/src/msn_chat.cpp +++ b/protocols/MSN/src/msn_chat.cpp @@ -63,19 +63,19 @@ int CMsnProto::MSN_ChatInit(GCThreadData *info, const char *pszID, const char *p gcw.pszModule = m_szModuleName; gcw.ptszName = szName; gcw.ptszID = info->mChatID; - CallServiceSync(MS_GC_NEWSESSION, 0, (LPARAM)&gcw); + Chat_NewSession(&gcw); GCDEST gcd = { m_szModuleName, info->mChatID, GC_EVENT_ADDGROUP }; GCEVENT gce = { sizeof(gce), &gcd }; for (int j = 0; j < _countof(m_ptszRoles); j++) { gce.ptszStatus = m_ptszRoles[j]; - CallServiceSync(MS_GC_EVENT, 0, (LPARAM)&gce); + Chat_Event(0, &gce); } gcd.iType = GC_EVENT_CONTROL; - CallServiceSync(MS_GC_EVENT, SESSION_INITDONE, (LPARAM)&gce); - CallServiceSync(MS_GC_EVENT, SESSION_ONLINE, (LPARAM)&gce); - CallServiceSync(MS_GC_EVENT, WINDOW_VISIBLE, (LPARAM)&gce); + Chat_Event(SESSION_INITDONE, &gce); + Chat_Event(SESSION_ONLINE, &gce); + Chat_Event(WINDOW_VISIBLE, &gce); mir_free((wchar_t*)gce.ptszUID); return 0; @@ -102,7 +102,7 @@ void CMsnProto::MSN_ChatStart(ezxml_t xmli) else { GCDEST gcd = { m_szModuleName, info->mChatID, GC_EVENT_CONTROL }; GCEVENT gce = { sizeof(gce), &gcd }; - CallServiceSync(MS_GC_EVENT, SESSION_ONLINE, (LPARAM)&gce); + Chat_Event(SESSION_ONLINE, &gce); } const char *pszCreator = ezxml_txt(ezxml_get(xmli, "properties", 0, "creator", -1)); @@ -148,8 +148,8 @@ void CMsnProto::MSN_KillChatSession(const wchar_t* id) GCDEST gcd = { m_szModuleName, id, GC_EVENT_CONTROL }; GCEVENT gce = { sizeof(gce), &gcd }; gce.dwFlags = GCEF_REMOVECONTACT; - 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); } void CMsnProto::MSN_Kickuser(GCHOOK *gch) @@ -190,7 +190,7 @@ void CMsnProto::MSN_GCProcessThreadActivity(ezxml_t xmli, const wchar_t *mChatID MCONTACT hContInitiator = MSN_HContactFromEmail(initiator ? initiator->txt : NULL); gce.ptszNick = GetContactNameT(hContInitiator); gce.ptszText = mir_a2u(ezxml_txt(ezxml_child(xmli, "value"))); - CallServiceSync(MS_GC_EVENT, 0, (LPARAM)&gce); + Chat_Event(0, &gce); mir_free((wchar_t*)gce.ptszUID); mir_free((wchar_t*)gce.ptszText); } @@ -247,12 +247,12 @@ void CMsnProto::MSN_GCProcessThreadActivity(ezxml_t xmli, const wchar_t *mChatID gce.ptszUID = mir_a2u(pszTarget); MCONTACT hContTarget = MSN_HContactFromEmail(pszTarget); gce.ptszNick = GetContactNameT(hContTarget); - CallServiceSync(MS_GC_EVENT, 0, (LPARAM)&gce); + Chat_Event(0, &gce); mir_free((wchar_t*)gce.ptszUID); if ((gcd.iType == GC_EVENT_PART || gcd.iType == GC_EVENT_KICK) && gce.bIsMe) { GCDEST gcd2 = { m_szModuleName, mChatID, GC_EVENT_CONTROL }; GCEVENT gce2 = { sizeof(gce2), &gcd2 }; - CallServiceSync(MS_GC_EVENT, SESSION_OFFLINE, (LPARAM)&gce2); + Chat_Event(SESSION_OFFLINE, &gce2); break; } target = ezxml_next(target); @@ -296,7 +296,7 @@ void CMsnProto::MSN_GCAddMessage(wchar_t *mChatID, MCONTACT hContact, char *emai gce.ptszText = EscapeChatTags(p); mir_free(p); - CallServiceSync(MS_GC_EVENT, 0, (LPARAM)&gce); + Chat_Event(0, &gce); mir_free((void*)gce.ptszUID); mir_free((void*)gce.ptszText); } @@ -516,7 +516,7 @@ int CMsnProto::MSN_GCEventHook(WPARAM, LPARAM lParam) gce.time = time(NULL); gce.ptszText = gch->ptszText; gce.bIsMe = TRUE; - CallServiceSync(MS_GC_EVENT, 0, (LPARAM)&gce); + Chat_Event(0, &gce); mir_free((void*)gce.ptszUID); if (!bError) diff --git a/protocols/MSN/src/msn_commands.cpp b/protocols/MSN/src/msn_commands.cpp index 93ac87ce7c..3c29b41bd6 100644 --- a/protocols/MSN/src/msn_commands.cpp +++ b/protocols/MSN/src/msn_commands.cpp @@ -393,7 +393,7 @@ void CMsnProto::MSN_ReceiveMessage(ThreadData* info, char* cmdString, char* para gci.Flags = GCF_HCONTACT; gci.pszModule = m_szModuleName; gci.pszID = mChatID; - CallServiceSync(MS_GC_GETINFO, 0, (LPARAM)&gci); + Chat_GetInfo(&gci); tContact = gci.hContact; } else tContact = MSN_HContactFromEmail(email, nick, true, true); @@ -1888,7 +1888,7 @@ LBL_InvalidCommand: gce.ptszUID = mir_a2u(data.userEmail); gce.time = time(NULL); gce.bIsMe = FALSE; - CallServiceSync(MS_GC_EVENT, 0, (LPARAM)&gce); + Chat_Event(0, &gce); mir_free((void*)gce.ptszUID); } @@ -1907,9 +1907,9 @@ LBL_InvalidCommand: gce.bIsMe = FALSE; gce.time = time(NULL); gce.ptszText = TranslateT("This conversation has been inactive, participants will be removed."); - CallServiceSync(MS_GC_EVENT, 0, (LPARAM)&gce); + Chat_Event(0, &gce); gce.ptszText = TranslateT("To resume the conversation, please quit this session and start a new chat session."); - CallServiceSync(MS_GC_EVENT, 0, (LPARAM)&gce); + Chat_Event(0, &gce); } else { if (!g_bTerminated && MessageBox(NULL, @@ -2145,7 +2145,7 @@ LBL_InvalidCommand: gce.ptszStatus = TranslateT("Others"); gce.time = time(NULL); gce.bIsMe = FALSE; - CallServiceSync(MS_GC_EVENT, 0, (LPARAM)&gce); + Chat_Event(0, &gce); mir_free((void*)gce.ptszUID); } else MSN_ChatStart(info); diff --git a/protocols/MSN/src/msn_misc.cpp b/protocols/MSN/src/msn_misc.cpp index 82808220e3..ad4ac92d1a 100644 --- a/protocols/MSN/src/msn_misc.cpp +++ b/protocols/MSN/src/msn_misc.cpp @@ -400,7 +400,7 @@ void CMsnProto::MSN_GoOffline(void) if (getWString(hContact, "ChatRoomID", &dbv) == 0) { GCDEST gcd = { m_szModuleName, dbv.ptszVal, GC_EVENT_CONTROL }; GCEVENT gce = { sizeof(gce), &gcd }; - CallServiceSync(MS_GC_EVENT, SESSION_OFFLINE, (LPARAM)&gce); + Chat_Event(SESSION_OFFLINE, &gce); db_free(&dbv); } } diff --git a/protocols/MSN/src/msn_proto.cpp b/protocols/MSN/src/msn_proto.cpp index 745505288c..86b68155bc 100644 --- a/protocols/MSN/src/msn_proto.cpp +++ b/protocols/MSN/src/msn_proto.cpp @@ -209,7 +209,7 @@ int CMsnProto::OnModulesLoaded(WPARAM, LPARAM) gcr.pColors = (COLORREF*)crCols; gcr.ptszDispName = m_tszUserName; gcr.pszModule = m_szModuleName; - CallServiceSync(MS_GC_REGISTER, 0, (LPARAM)&gcr); + Chat_Register(&gcr); HookProtoEvent(ME_GC_EVENT, &CMsnProto::MSN_GCEventHook); HookProtoEvent(ME_GC_BUILDMENU, &CMsnProto::MSN_GCMenuHook); -- cgit v1.2.3