summaryrefslogtreecommitdiff
path: root/protocols/MRA/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2016-09-16 19:43:24 +0000
committerGeorge Hazan <george.hazan@gmail.com>2016-09-16 19:43:24 +0000
commit0c41e6c4566fdb2d99b8a6ca1fb48859fd4a0e34 (patch)
tree700937499ee66952d1ca5b92928fc9ec3b034447 /protocols/MRA/src
parent7a7a6637021d78ad995f3e21e9743fae69bd2562 (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 'protocols/MRA/src')
-rw-r--r--protocols/MRA/src/MraChat.cpp19
-rw-r--r--protocols/MRA/src/Mra_functions.cpp2
2 files changed, 9 insertions, 12 deletions
diff --git a/protocols/MRA/src/MraChat.cpp b/protocols/MRA/src/MraChat.cpp
index 9033968d25..7deb944d20 100644
--- a/protocols/MRA/src/MraChat.cpp
+++ b/protocols/MRA/src/MraChat.cpp
@@ -13,15 +13,12 @@ void CMraProto::MraChatDllError()
bool CMraProto::MraChatRegister()
{
- if (!ServiceExists(MS_GC_REGISTER))
- return FALSE;
-
GCREGISTER gcr = { sizeof(gcr) };
gcr.iMaxText = MRA_MAXLENOFMESSAGE;
gcr.nColors = 0;
gcr.ptszDispName = m_tszUserName;
gcr.pszModule = m_szModuleName;
- CallServiceSync(MS_GC_REGISTER, NULL, (LPARAM)&gcr);
+ Chat_Register(&gcr);
HookProtoEvent(ME_GC_EVENT, &CMraProto::MraChatGcEventHook);
return TRUE;
@@ -41,17 +38,17 @@ INT_PTR CMraProto::MraChatSessionNew(MCONTACT hContact)
gcw.ptszID = wszEMail;
gcw.ptszStatusbarText = L"status bar";
gcw.dwItemData = (DWORD)hContact;
- if (!CallServiceSync(MS_GC_NEWSESSION, NULL, (LPARAM)&gcw)) {
+ if (!Chat_NewSession(&gcw)) {
GCDEST gcd = { m_szModuleName, wszEMail.c_str(), GC_EVENT_ADDGROUP };
GCEVENT gce = { sizeof(gce), &gcd };
for (int i = 0; i < _countof(lpwszStatuses); i++) {
gce.ptszStatus = TranslateW(lpwszStatuses[i]);
- CallServiceSync(MS_GC_EVENT, NULL, (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);
+ Chat_Event(SESSION_INITDONE, &gce);
+ Chat_Event(SESSION_ONLINE, &gce);
DWORD opcode = MULTICHAT_GET_MEMBERS;
CMStringA szEmail;
@@ -75,8 +72,8 @@ void CMraProto::MraChatSessionDestroy(MCONTACT hContact)
mraGetStringW(hContact, "e-mail", wszEMail);
gcd.ptszID = (LPWSTR)wszEMail.c_str();
- CallServiceSync(MS_GC_EVENT, SESSION_TERMINATE, (LPARAM)&gce);
- CallServiceSync(MS_GC_EVENT, WINDOW_CLEARLOG, (LPARAM)&gce);
+ Chat_Event(SESSION_TERMINATE, &gce);
+ Chat_Event(WINDOW_CLEARLOG, &gce);
}
INT_PTR CMraProto::MraChatSessionEventSendByHandle(MCONTACT hContactChatSession, int iType, DWORD dwFlags, const CMStringA &lpszUID, LPCWSTR lpwszStatus, LPCWSTR lpwszMessage, DWORD_PTR dwItemData, DWORD dwTime)
@@ -119,7 +116,7 @@ INT_PTR CMraProto::MraChatSessionEventSendByHandle(MCONTACT hContactChatSession,
gce.ptszNick = wszUID;
}
- return CallServiceSync(MS_GC_EVENT, NULL, (LPARAM)&gce);
+ return Chat_Event(0, &gce);
}
INT_PTR CMraProto::MraChatSessionInvite(MCONTACT hContactChatSession, const CMStringA &lpszEMailInMultiChat, DWORD dwTime)
diff --git a/protocols/MRA/src/Mra_functions.cpp b/protocols/MRA/src/Mra_functions.cpp
index ea2913deba..f7e8a33f39 100644
--- a/protocols/MRA/src/Mra_functions.cpp
+++ b/protocols/MRA/src/Mra_functions.cpp
@@ -532,7 +532,7 @@ MCONTACT CMraProto::MraHContactFromEmail(const CMStringA &szEmail, BOOL bAddIfNe
gcw.ptszName = wszEMail;
gcw.ptszID = (LPWSTR)wszEMail.c_str();
- if (CallServiceSync(MS_GC_NEWSESSION, NULL, (LPARAM)&gcw) == 0) {
+ if (Chat_NewSession(&gcw) == 0) {
BOOL bChatAdded = FALSE;
for (hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
if (mraGetStringA(hContact, "ChatRoomID", szEMailLocal)) {