diff options
author | George Hazan <george.hazan@gmail.com> | 2013-06-17 22:37:15 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-06-17 22:37:15 +0000 |
commit | 070ae988a2704d6bea4733e12f644f3d02e71b7f (patch) | |
tree | 056758c3fe8adb386ee7fa40f94e1d0ae04dea5b /src/modules/protocols/protocols.cpp | |
parent | 6c4d35fca373a55252f4bce0bd0102f78eb67037 (diff) |
ProtoBroadcastAck macro converted into a function
git-svn-id: http://svn.miranda-ng.org/main/trunk@5007 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/modules/protocols/protocols.cpp')
-rw-r--r-- | src/modules/protocols/protocols.cpp | 29 |
1 files changed, 7 insertions, 22 deletions
diff --git a/src/modules/protocols/protocols.cpp b/src/modules/protocols/protocols.cpp index ef2a4b7eac..c89f4734ae 100644 --- a/src/modules/protocols/protocols.cpp +++ b/src/modules/protocols/protocols.cpp @@ -27,7 +27,7 @@ int LoadProtoChains(void); int LoadProtoOptions(void);
HANDLE hAccListChanged;
-static HANDLE hAckEvent, hTypeEvent;
+static HANDLE hTypeEvent;
static BOOL bModuleInitialized = FALSE;
typedef struct
@@ -65,22 +65,6 @@ LIST<PROTOCOLDESCRIPTOR> filters(10, CompareProtos2); //------------------------------------------------------------------------------------
-static INT_PTR Proto_BroadcastAck(WPARAM wParam, LPARAM lParam)
-{
- ACKDATA *ack = (ACKDATA*)lParam;
- if (ack && ack->type == ACKTYPE_AVATAR && ack->hProcess) {
- PROTO_AVATAR_INFORMATION* ai = (PROTO_AVATAR_INFORMATION*)ack->hProcess;
- if (ai->cbSize == sizeof(PROTO_AVATAR_INFORMATION)) {
- PROTO_AVATAR_INFORMATIONW aiw = { sizeof(aiw), ai->hContact, ai->format };
- MultiByteToWideChar(CP_ACP, 0, ai->filename, -1, aiw.filename, SIZEOF(aiw.filename));
-
- ack->hProcess = &aiw;
- }
- }
-
- return NotifyEventHooks(hAckEvent, wParam, lParam);
-}
-
INT_PTR __fastcall MyCallProtoService(const char *szModule, const char *szService, WPARAM wParam, LPARAM lParam);
void FreeFilesMatrix(TCHAR ***files);
@@ -367,6 +351,12 @@ static INT_PTR srvProto_IsAccountLocked(WPARAM, LPARAM lParam) return (INT_PTR)Proto_IsAccountLocked(Proto_GetAccount((char*)lParam));
}
+static INT_PTR Proto_BroadcastAck(WPARAM, LPARAM lParam)
+{
+ ACKDATA *ack = (ACKDATA*)lParam;
+ return ProtoBroadcastAck(ack->szModule, ack->hProcess, ack->type, ack->result, ack->hProcess, ack->lParam);
+}
+
/////////////////////////////////////////////////////////////////////////////////////////
INT_PTR CallProtoService(const char* szModule, const char* szService, WPARAM wParam, LPARAM lParam)
@@ -718,7 +708,6 @@ int LoadProtocolsModule(void) InsertServiceListItem(109, PS_SEARCHBYNAMEW);
InsertServiceListItem(110, PS_SEARCHBYEMAILW);
- hAckEvent = CreateHookableEvent(ME_PROTO_ACK);
hTypeEvent = CreateHookableEvent(ME_PROTO_CONTACTISTYPING);
hAccListChanged = CreateHookableEvent(ME_PROTO_ACCLISTCHANGED);
@@ -749,10 +738,6 @@ void UnloadProtocolsModule() {
if ( !bModuleInitialized) return;
- if (hAckEvent) {
- DestroyHookableEvent(hAckEvent);
- hAckEvent = NULL;
- }
if (hAccListChanged) {
DestroyHookableEvent(hAccListChanged);
hAccListChanged = NULL;
|