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 /protocols/JabberG | |
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 'protocols/JabberG')
-rw-r--r-- | protocols/JabberG/src/jabber.cpp | 12 | ||||
-rw-r--r-- | protocols/JabberG/src/jabber_chat.cpp | 18 | ||||
-rw-r--r-- | protocols/JabberG/src/jabber_groupchat.cpp | 8 | ||||
-rw-r--r-- | protocols/JabberG/src/jabber_iqid.cpp | 2 | ||||
-rwxr-xr-x | protocols/JabberG/src/jabber_proto.cpp | 2 |
5 files changed, 20 insertions, 22 deletions
diff --git a/protocols/JabberG/src/jabber.cpp b/protocols/JabberG/src/jabber.cpp index 025b0c4125..ff4ec8afe3 100644 --- a/protocols/JabberG/src/jabber.cpp +++ b/protocols/JabberG/src/jabber.cpp @@ -183,15 +183,13 @@ extern "C" int __declspec(dllexport) Load() {
// set the memory, lists & utf8 managers
mir_getLP(&pluginInfo);
+ pci = Chat_GetInterface();
pcli = Clist_GetInterface();
- mir_getCI(NULL);
- {
- INT_PTR result = CallService(MS_IMG_GETINTERFACE, FI_IF_VERSION, (LPARAM)&FIP);
- if (FIP == NULL || result != S_OK) {
- MessageBoxEx(NULL, TranslateT("Fatal error, image services not found. Jabber Protocol will be disabled."), L"Error", MB_OK | MB_ICONERROR | MB_APPLMODAL, 0);
- return 1;
- }
+ INT_PTR result = CallService(MS_IMG_GETINTERFACE, FI_IF_VERSION, (LPARAM)&FIP);
+ if (FIP == NULL || result != S_OK) {
+ MessageBoxEx(NULL, TranslateT("Fatal error, image services not found. Jabber Protocol will be disabled."), L"Error", MB_OK | MB_ICONERROR | MB_APPLMODAL, 0);
+ return 1;
}
WORD v[4];
diff --git a/protocols/JabberG/src/jabber_chat.cpp b/protocols/JabberG/src/jabber_chat.cpp index a3c53cd3ce..32e353d586 100644 --- a/protocols/JabberG/src/jabber_chat.cpp +++ b/protocols/JabberG/src/jabber_chat.cpp @@ -133,7 +133,7 @@ int CJabberProto::GcInit(JABBER_LIST_ITEM *item) gcw.pszModule = m_szModuleName;
gcw.ptszName = szNick;
gcw.ptszID = item->jid;
- CallServiceSync(MS_GC_NEWSESSION, NULL, (LPARAM)&gcw);
+ Chat_NewSession(&gcw);
GCSessionInfoBase *si = pci->SM_FindSession(item->jid, m_szModuleName);
if (si != NULL) {
@@ -171,12 +171,12 @@ int CJabberProto::GcInit(JABBER_LIST_ITEM *item) GCEVENT gce = { sizeof(gce), &gcd };
for (int i = _countof(sttStatuses) - 1; i >= 0; i--) {
gce.ptszStatus = TranslateW(sttStatuses[i]);
- CallServiceSync(MS_GC_EVENT, NULL, (LPARAM)&gce);
+ Chat_Event(0, &gce);
}
gcd.iType = GC_EVENT_CONTROL;
- CallServiceSync(MS_GC_EVENT, (item->bAutoJoin && m_options.AutoJoinHidden) ? WINDOW_HIDDEN : SESSION_INITDONE, (LPARAM)&gce);
- CallServiceSync(MS_GC_EVENT, SESSION_ONLINE, (LPARAM)&gce);
+ Chat_Event((item->bAutoJoin && m_options.AutoJoinHidden) ? WINDOW_HIDDEN : SESSION_INITDONE, &gce);
+ Chat_Event(SESSION_ONLINE, &gce);
return 0;
}
@@ -249,7 +249,7 @@ void CJabberProto::GcLogShowInformation(JABBER_LIST_ITEM *item, pResourceStatus gce.ptszText = buf;
gce.dwFlags = GCEF_ADDTOLOG;
gce.time = time(0);
- CallServiceSync(MS_GC_EVENT, NULL, (LPARAM)&gce);
+ Chat_Event(0, &gce);
}
}
@@ -308,7 +308,7 @@ void CJabberProto::GcLogUpdateMemberStatus(JABBER_LIST_ITEM *item, const wchar_t }
}
- CallServiceSync(MS_GC_EVENT, NULL, (LPARAM)&gce);
+ Chat_Event(0, &gce);
if (statusToSet != 0) {
gce.ptszText = nick;
@@ -317,12 +317,12 @@ void CJabberProto::GcLogUpdateMemberStatus(JABBER_LIST_ITEM *item, const wchar_t else
gce.dwItemData = 1;
gcd.iType = GC_EVENT_SETSTATUSEX;
- CallServiceSync(MS_GC_EVENT, NULL, (LPARAM)&gce);
+ Chat_Event(0, &gce);
gce.ptszUID = resource;
gce.dwItemData = statusToSet;
gcd.iType = GC_EVENT_SETCONTACTSTATUS;
- CallServiceSync(MS_GC_EVENT, NULL, (LPARAM)&gce);
+ Chat_Event(0, &gce);
}
}
@@ -346,7 +346,7 @@ void CJabberProto::GcQuit(JABBER_LIST_ITEM *item, int code, HXML reason) GCEVENT gce = { sizeof(gce), &gcd };
gce.ptszUID = item->jid;
gce.ptszText = XmlGetText(reason);
- CallServiceSync(MS_GC_EVENT, (code == 200) ? SESSION_TERMINATE : SESSION_OFFLINE, (LPARAM)&gce);
+ Chat_Event((code == 200) ? SESSION_TERMINATE : SESSION_OFFLINE, &gce);
db_unset(item->hContact, "CList", "Hidden");
item->bChatActive = false;
diff --git a/protocols/JabberG/src/jabber_groupchat.cpp b/protocols/JabberG/src/jabber_groupchat.cpp index 433414bb59..6e6306ab66 100644 --- a/protocols/JabberG/src/jabber_groupchat.cpp +++ b/protocols/JabberG/src/jabber_groupchat.cpp @@ -802,13 +802,13 @@ void CJabberProto::RenameParticipantNick(JABBER_LIST_ITEM *item, const wchar_t * if (jid != NULL)
gce.ptszUserInfo = jid;
gce.time = time(0);
- CallServiceSync(MS_GC_EVENT, NULL, (LPARAM)&gce);
+ Chat_Event(0, &gce);
gcd.iType = GC_EVENT_NICK;
gce.ptszNick = oldNick;
gce.ptszUID = newNick;
gce.ptszText = newNick;
- CallServiceSync(MS_GC_EVENT, NULL, (LPARAM)&gce);
+ Chat_Event(0, &gce);
}
void CJabberProto::GroupchatProcessPresence(HXML node)
@@ -1123,14 +1123,14 @@ void CJabberProto::GroupchatProcessMessage(HXML node) if (m_options.GcLogChatHistory && isHistory)
gce.dwFlags |= GCEF_NOTNOTIFY;
- CallServiceSync(MS_GC_EVENT, NULL, (LPARAM)&gce);
+ Chat_Event(0, &gce);
item->bChatActive = 2;
if (gcd.iType == GC_EVENT_TOPIC) {
gce.dwFlags &= ~GCEF_ADDTOLOG;
gcd.iType = GC_EVENT_SETSBTEXT;
- CallServiceSync(MS_GC_EVENT, NULL, (LPARAM)&gce);
+ Chat_Event(0, &gce);
}
}
diff --git a/protocols/JabberG/src/jabber_iqid.cpp b/protocols/JabberG/src/jabber_iqid.cpp index d2c836869d..597c513f64 100644 --- a/protocols/JabberG/src/jabber_iqid.cpp +++ b/protocols/JabberG/src/jabber_iqid.cpp @@ -450,7 +450,7 @@ void CJabberProto::OnIqResultGetRoster(HXML iqNode, CJabberIqInfo *pInfo) if (p)
*p = 0;
- CallServiceSync(MS_GC_NEWSESSION, 0, (LPARAM)&gcw);
+ Chat_NewSession(&gcw);
db_unset(hContact, "CList", "Hidden");
chatRooms.insert((HANDLE)hContact);
diff --git a/protocols/JabberG/src/jabber_proto.cpp b/protocols/JabberG/src/jabber_proto.cpp index 6922e35a59..b97423b7dc 100755 --- a/protocols/JabberG/src/jabber_proto.cpp +++ b/protocols/JabberG/src/jabber_proto.cpp @@ -223,7 +223,7 @@ int CJabberProto::OnModulesLoadedEx(WPARAM, LPARAM) gcr.pColors = &crCols[0];
gcr.ptszDispName = m_tszUserName;
gcr.pszModule = m_szModuleName;
- CallServiceSync(MS_GC_REGISTER, NULL, (LPARAM)&gcr);
+ Chat_Register(&gcr);
HookProtoEvent(ME_GC_EVENT, &CJabberProto::JabberGcEventHook);
HookProtoEvent(ME_GC_BUILDMENU, &CJabberProto::JabberGcMenuHook);
|