diff options
author | George Hazan <ghazan@miranda.im> | 2018-01-31 17:51:08 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-01-31 17:51:08 +0300 |
commit | bdd6a8a6b981a019e6818230077567b4fb51604c (patch) | |
tree | f7d0160b8014b9ab939c280a955840323db6265f /src/mir_app | |
parent | 1124c2c24cde3fffa979b5d6e483a70d3cb75063 (diff) |
mir_app:
- structure renamed: PROTORECVFILET -> PROTORECVFILE;
- useless service MS_PROTO_AUTHRECV removed;
- Proto_AuthRecv() helper converted into a function.
Diffstat (limited to 'src/mir_app')
-rw-r--r-- | src/mir_app/src/mir_app.def | 3 | ||||
-rw-r--r-- | src/mir_app/src/mir_app64.def | 3 | ||||
-rw-r--r-- | src/mir_app/src/proto_internal.cpp | 2 | ||||
-rw-r--r-- | src/mir_app/src/proto_utils.cpp | 2 | ||||
-rw-r--r-- | src/mir_app/src/protocols.cpp | 20 |
5 files changed, 16 insertions, 14 deletions
diff --git a/src/mir_app/src/mir_app.def b/src/mir_app/src/mir_app.def index e07917fdb9..3fde886325 100644 --- a/src/mir_app/src/mir_app.def +++ b/src/mir_app/src/mir_app.def @@ -56,7 +56,7 @@ Skin_GetIconName @24 ?ProtoBroadcastAck@PROTO_INTERFACE@@QAEHIHHPAXJ@Z @56 NONAME
?RecvAwayMsg@PROTO_INTERFACE@@UAAHIHPAUPROTORECVEVENT@@@Z @57 NONAME
?RecvContacts@PROTO_INTERFACE@@UAAHIPAUPROTORECVEVENT@@@Z @58 NONAME
-?RecvFile@PROTO_INTERFACE@@UAAHIPAUPROTORECVFILET@@@Z @59 NONAME
+?RecvFile@PROTO_INTERFACE@@UAAHIPAUPROTORECVFILE@@@Z @59 NONAME
?RecvMsg@PROTO_INTERFACE@@UAAHIPAUPROTORECVEVENT@@@Z @60 NONAME
?RecvUrl@PROTO_INTERFACE@@UAAHIPAUPROTORECVEVENT@@@Z @61 NONAME
?SearchAdvanced@PROTO_INTERFACE@@UAAPAUHWND__@@PAU2@@Z @62 NONAME
@@ -486,3 +486,4 @@ Contact_AddBySearch @499 ?setAllContactStatuses@PROTO_INTERFACE@@QAEXH_N@Z @500 NONAME
??0PROTO_INTERFACE@@QAE@PBDPB_W@Z @501 NONAME
??1PROTO_INTERFACE@@QAE@XZ @502 NONAME
+Proto_AuthRecv @503
diff --git a/src/mir_app/src/mir_app64.def b/src/mir_app/src/mir_app64.def index 528431bf8c..31958bb466 100644 --- a/src/mir_app/src/mir_app64.def +++ b/src/mir_app/src/mir_app64.def @@ -56,7 +56,7 @@ Skin_GetIconName @24 ?ProtoBroadcastAck@PROTO_INTERFACE@@QEAA_JIHHPEAX_J@Z @56 NONAME
?RecvAwayMsg@PROTO_INTERFACE@@UEAAHIHPEAUPROTORECVEVENT@@@Z @57 NONAME
?RecvContacts@PROTO_INTERFACE@@UEAAHIPEAUPROTORECVEVENT@@@Z @58 NONAME
-?RecvFile@PROTO_INTERFACE@@UEAAHIPEAUPROTORECVFILET@@@Z @59 NONAME
+?RecvFile@PROTO_INTERFACE@@UEAAHIPEAUPROTORECVFILE@@@Z @59 NONAME
?RecvMsg@PROTO_INTERFACE@@UEAAHIPEAUPROTORECVEVENT@@@Z @60 NONAME
?RecvUrl@PROTO_INTERFACE@@UEAAHIPEAUPROTORECVEVENT@@@Z @61 NONAME
?SearchAdvanced@PROTO_INTERFACE@@UEAAPEAUHWND__@@PEAU2@@Z @62 NONAME
@@ -486,3 +486,4 @@ Contact_AddBySearch @499 ?setAllContactStatuses@PROTO_INTERFACE@@QEAAXH_N@Z @500 NONAME
??0PROTO_INTERFACE@@QEAA@PEBDPEB_W@Z @501 NONAME
??1PROTO_INTERFACE@@QEAA@XZ @502 NONAME
+Proto_AuthRecv @503
diff --git a/src/mir_app/src/proto_internal.cpp b/src/mir_app/src/proto_internal.cpp index 3d95b50fd0..437f9cd0a4 100644 --- a/src/mir_app/src/proto_internal.cpp +++ b/src/mir_app/src/proto_internal.cpp @@ -191,7 +191,7 @@ struct DEFAULT_PROTO_INTERFACE : public PROTO_INTERFACE return (int)ProtoCallService(m_szModuleName, PSR_CONTACTS, 0, (LPARAM)&ccs);
}
- virtual int __cdecl RecvFile(MCONTACT hContact, PROTORECVFILET* evt) override
+ virtual int __cdecl RecvFile(MCONTACT hContact, PROTORECVFILE* evt) override
{
CCSDATA ccs = { hContact, PSR_FILE, 0, (LPARAM)evt };
return ProtoCallService(m_szModuleName, PSR_FILE, 0, (LPARAM)&ccs);
diff --git a/src/mir_app/src/proto_utils.cpp b/src/mir_app/src/proto_utils.cpp index 5561ef87f2..f667522e06 100644 --- a/src/mir_app/src/proto_utils.cpp +++ b/src/mir_app/src/proto_utils.cpp @@ -388,7 +388,7 @@ int PROTO_INTERFACE::RecvContacts(MCONTACT, PROTORECVEVENT*) return 1; // error
}
-int PROTO_INTERFACE::RecvFile(MCONTACT hContact, PROTORECVFILET *evt)
+int PROTO_INTERFACE::RecvFile(MCONTACT hContact, PROTORECVFILE *evt)
{
return ::Proto_RecvFile(hContact, evt); // default file receiver
}
diff --git a/src/mir_app/src/protocols.cpp b/src/mir_app/src/protocols.cpp index 132d8bd95a..2e9d6652b8 100644 --- a/src/mir_app/src/protocols.cpp +++ b/src/mir_app/src/protocols.cpp @@ -182,18 +182,19 @@ static INT_PTR Proto_RecvMessage(WPARAM, LPARAM lParam) return (INT_PTR)db_event_add(ccs->hContact, &dbei);
}
-static INT_PTR Proto_AuthRecv(WPARAM wParam, LPARAM lParam)
+MIR_APP_DLL(MEVENT) Proto_AuthRecv(const char *szProtoName, PROTORECVEVENT *pcre)
{
- PROTORECVEVENT* pre = (PROTORECVEVENT*)lParam;
+ if (szProtoName == nullptr || pcre == nullptr)
+ return 0;
DBEVENTINFO dbei = {};
- dbei.szModule = (char*)wParam;
- dbei.timestamp = pre->timestamp;
- dbei.flags = DBEF_UTF | pre->flags & (PREF_CREATEREAD ? DBEF_READ : 0);
+ dbei.szModule = (char*)szProtoName;
+ dbei.timestamp = pcre->timestamp;
+ dbei.flags = DBEF_UTF | pcre->flags & (PREF_CREATEREAD ? DBEF_READ : 0);
dbei.eventType = EVENTTYPE_AUTHREQUEST;
- dbei.cbBlob = pre->lParam;
- dbei.pBlob = (PBYTE)pre->szMessage;
- return (INT_PTR)db_event_add(0, &dbei);
+ dbei.cbBlob = pcre->lParam;
+ dbei.pBlob = (PBYTE)pcre->szMessage;
+ return db_event_add(0, &dbei);
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -404,7 +405,7 @@ INT_PTR CallProtoServiceInt(MCONTACT hContact, const char *szModule, const char case 18: return (INT_PTR)ppi->SearchAdvanced((HWND)lParam);
case 19: return (INT_PTR)ppi->CreateExtendedSearchUI((HWND)lParam);
case 20: return (INT_PTR)ppi->RecvContacts(hContact, (PROTORECVEVENT*)lParam);
- case 21: return (INT_PTR)ppi->RecvFile(hContact, (PROTORECVFILET*)lParam);
+ case 21: return (INT_PTR)ppi->RecvFile(hContact, (PROTORECVFILE*)lParam);
case 22: return (INT_PTR)ppi->RecvMsg(hContact, (PROTORECVEVENT*)lParam);
case 23: return (INT_PTR)ppi->RecvUrl(hContact, (PROTORECVEVENT*)lParam);
case 24: return (INT_PTR)ppi->SendContacts(hContact, LOWORD(wParam), HIWORD(wParam), (MCONTACT*)lParam);
@@ -460,7 +461,6 @@ int LoadProtocolsModule(void) CreateServiceFunction(MS_PROTO_CONTACTISTYPING, Proto_ContactIsTyping);
CreateServiceFunction(MS_PROTO_RECVMSG, Proto_RecvMessage);
- CreateServiceFunction(MS_PROTO_AUTHRECV, Proto_AuthRecv);
CreateServiceFunction(MS_PROTO_CREATEACCOUNT, srvProto_CreateAccount);
|