diff options
author | George Hazan <george.hazan@gmail.com> | 2015-06-01 18:10:32 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2015-06-01 18:10:32 +0000 |
commit | 2bb514f4195c99b52e0ec748c975c0fd30dbbd25 (patch) | |
tree | e7325f314a828e1233b89ef688e6e52a8846925a /src | |
parent | a59538975c7fef04bcbf9e62b81c78753ac2a16c (diff) |
another bunch of dead crutches: non-unicode avatar services
git-svn-id: http://svn.miranda-ng.org/main/trunk@13961 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src')
-rw-r--r-- | src/core/stdmsg/src/msgdialog.cpp | 4 | ||||
-rw-r--r-- | src/mir_core/src/protos.cpp | 12 | ||||
-rw-r--r-- | src/modules/metacontacts/meta_edit.cpp | 4 | ||||
-rw-r--r-- | src/modules/metacontacts/meta_menu.cpp | 4 | ||||
-rw-r--r-- | src/modules/metacontacts/meta_services.cpp | 19 | ||||
-rw-r--r-- | src/modules/metacontacts/meta_utils.cpp | 5 | ||||
-rw-r--r-- | src/modules/protocols/protoaccs.cpp | 52 |
7 files changed, 17 insertions, 83 deletions
diff --git a/src/core/stdmsg/src/msgdialog.cpp b/src/core/stdmsg/src/msgdialog.cpp index 399703ec52..59f56219a2 100644 --- a/src/core/stdmsg/src/msgdialog.cpp +++ b/src/core/stdmsg/src/msgdialog.cpp @@ -912,8 +912,8 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP case DM_GETAVATAR:
{
- PROTO_AVATAR_INFORMATIONT ai = { sizeof(ai), dat->hContact };
- CallProtoService(dat->szProto, PS_GETAVATARINFOT, GAIF_FORCE, (LPARAM)&ai);
+ PROTO_AVATAR_INFORMATION ai = { sizeof(ai), dat->hContact };
+ CallProtoService(dat->szProto, PS_GETAVATARINFO, GAIF_FORCE, (LPARAM)&ai);
ShowAvatar(hwndDlg, dat);
SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, 1);
diff --git a/src/mir_core/src/protos.cpp b/src/mir_core/src/protos.cpp index 2e4f009cdc..154ff2ad26 100644 --- a/src/mir_core/src/protos.cpp +++ b/src/mir_core/src/protos.cpp @@ -93,18 +93,6 @@ MIR_CORE_DLL(void) ProtoLogW(struct PROTO_INTERFACE *pThis, LPCWSTR wszFormat, v MIR_CORE_DLL(INT_PTR) ProtoBroadcastAck(const char *szModule, MCONTACT hContact, int type, int result, HANDLE hProcess, LPARAM lParam)
{
- if (type == ACKTYPE_AVATAR && hProcess) {
- PROTO_AVATAR_INFORMATION* ai = (PROTO_AVATAR_INFORMATION*)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));
-
- hProcess = &aiw;
- ACKDATA ack = { sizeof(ACKDATA), szModule, hContact, type, result, hProcess, lParam };
- return NotifyEventHooks(hAckEvent, 0, (LPARAM)&ack);
- }
- }
-
ACKDATA ack = { sizeof(ACKDATA), szModule, hContact, type, result, hProcess, lParam };
return NotifyEventHooks(hAckEvent, 0, (LPARAM)&ack);
}
diff --git a/src/modules/metacontacts/meta_edit.cpp b/src/modules/metacontacts/meta_edit.cpp index fba8032489..e4eabf0347 100644 --- a/src/modules/metacontacts/meta_edit.cpp +++ b/src/modules/metacontacts/meta_edit.cpp @@ -164,11 +164,11 @@ static void ApplyChanges() // fix avatar
most_online = Meta_GetMostOnlineSupporting(g_data.cc, PFLAGNUM_4, PF4_AVATARS);
if (most_online) {
- PROTO_AVATAR_INFORMATIONT AI = { sizeof(AI) };
+ PROTO_AVATAR_INFORMATION AI = { sizeof(AI) };
AI.hContact = g_data.hMeta;
AI.format = PA_FORMAT_UNKNOWN;
_tcsncpy_s(AI.filename, _T("X"), _TRUNCATE);
- if (CallProtoService(META_PROTO, PS_GETAVATARINFOT, 0, (LPARAM)&AI) == GAIR_SUCCESS)
+ if (CallProtoService(META_PROTO, PS_GETAVATARINFO, 0, (LPARAM)&AI) == GAIR_SUCCESS)
db_set_ts(g_data.hMeta, "ContactPhoto", "File", AI.filename);
}
}
diff --git a/src/modules/metacontacts/meta_menu.cpp b/src/modules/metacontacts/meta_menu.cpp index 3ecbf8481c..495768c9fd 100644 --- a/src/modules/metacontacts/meta_menu.cpp +++ b/src/modules/metacontacts/meta_menu.cpp @@ -160,12 +160,12 @@ void Meta_RemoveContactNumber(DBCachedContact *ccMeta, int number, bool bUpdateI // fix avatar
MCONTACT hContact = Meta_GetMostOnlineSupporting(ccMeta, PFLAGNUM_4, PF4_AVATARS);
if (hContact) {
- PROTO_AVATAR_INFORMATIONT AI = { sizeof(AI) };
+ PROTO_AVATAR_INFORMATION AI = { sizeof(AI) };
AI.hContact = ccMeta->contactID;
AI.format = PA_FORMAT_UNKNOWN;
_tcsncpy_s(AI.filename, _T("X"), _TRUNCATE);
- if (CallProtoService(META_PROTO, PS_GETAVATARINFOT, 0, (LPARAM)&AI) == GAIR_SUCCESS)
+ if (CallProtoService(META_PROTO, PS_GETAVATARINFO, 0, (LPARAM)&AI) == GAIR_SUCCESS)
db_set_ts(ccMeta->contactID, "ContactPhoto", "File", AI.filename);
}
}
diff --git a/src/modules/metacontacts/meta_services.cpp b/src/modules/metacontacts/meta_services.cpp index b947a6f551..3b48c62c69 100644 --- a/src/modules/metacontacts/meta_services.cpp +++ b/src/modules/metacontacts/meta_services.cpp @@ -303,8 +303,8 @@ int Meta_HandleACK(WPARAM, LPARAM lParam) }
if (ack->hProcess) {
- PROTO_AVATAR_INFORMATIONT AI;
- memcpy(&AI, (PROTO_AVATAR_INFORMATIONT *)ack->hProcess, sizeof(PROTO_AVATAR_INFORMATIONT));
+ PROTO_AVATAR_INFORMATION AI;
+ memcpy(&AI, (PROTO_AVATAR_INFORMATION *)ack->hProcess, sizeof(PROTO_AVATAR_INFORMATION));
if (AI.hContact)
AI.hContact = cc->contactID;
@@ -442,11 +442,11 @@ int Meta_SettingChanged(WPARAM hContact, LPARAM lParam) // most online contact with avatar support might have changed - update avatar
hMostOnline = Meta_GetMostOnlineSupporting(ccMeta, PFLAGNUM_4, PF4_AVATARS);
if (hMostOnline) {
- PROTO_AVATAR_INFORMATIONT AI = { sizeof(AI) };
+ PROTO_AVATAR_INFORMATION AI = { sizeof(AI) };
AI.hContact = ccMeta->contactID;
AI.format = PA_FORMAT_UNKNOWN;
_tcsncpy_s(AI.filename, _T("X"), _TRUNCATE);
- if (CallProtoService(META_PROTO, PS_GETAVATARINFOT, 0, (LPARAM)&AI) == GAIR_SUCCESS)
+ if (CallProtoService(META_PROTO, PS_GETAVATARINFO, 0, (LPARAM)&AI) == GAIR_SUCCESS)
db_set_ts(ccMeta->contactID, "ContactPhoto", "File", AI.filename);
}
}
@@ -748,7 +748,7 @@ INT_PTR Meta_GetAwayMsg(WPARAM wParam, LPARAM lParam) INT_PTR Meta_GetAvatarInfo(WPARAM wParam, LPARAM lParam)
{
- PROTO_AVATAR_INFORMATIONT *AI = (PROTO_AVATAR_INFORMATIONT*)lParam;
+ PROTO_AVATAR_INFORMATION *AI = (PROTO_AVATAR_INFORMATION*)lParam;
DBCachedContact *cc = CheckMeta(AI->hContact);
if (cc == NULL)
return GAIR_NOAVATAR;
@@ -765,7 +765,7 @@ INT_PTR Meta_GetAvatarInfo(WPARAM wParam, LPARAM lParam) return GAIR_NOAVATAR;
AI->hContact = hSub;
- INT_PTR result = CallProtoService(proto, PS_GETAVATARINFOT, wParam, lParam);
+ INT_PTR result = CallProtoService(proto, PS_GETAVATARINFO, wParam, lParam);
AI->hContact = cc->contactID;
if (result != CALLSERVICE_NOTFOUND)
return result;
@@ -791,12 +791,11 @@ INT_PTR Meta_GetInfo(WPARAM wParam, LPARAM lParam) if (!proto)
return 0;
- PROTO_AVATAR_INFORMATIONT AI;
- AI.cbSize = sizeof(AI);
+ PROTO_AVATAR_INFORMATION AI;
AI.hContact = ccs->hContact;
AI.format = PA_FORMAT_UNKNOWN;
_tcsncpy_s(AI.filename, _T("X"), _TRUNCATE);
- if (CallProtoService(META_PROTO, PS_GETAVATARINFOT, 0, (LPARAM)&AI) == GAIR_SUCCESS)
+ if (CallProtoService(META_PROTO, PS_GETAVATARINFO, 0, (LPARAM)&AI) == GAIR_SUCCESS)
db_set_ts(ccs->hContact, "ContactPhoto", "File", AI.filename);
hMostOnline = Meta_GetMostOnline(cc);
@@ -873,7 +872,7 @@ void Meta_InitServices() // file recv is done by subcontacts
CreateProtoServiceFunction(META_PROTO, PSS_FILE, Meta_FileSend);
CreateProtoServiceFunction(META_PROTO, PSS_GETAWAYMSG, Meta_GetAwayMsg);
- CreateProtoServiceFunction(META_PROTO, PS_GETAVATARINFOT, Meta_GetAvatarInfo);
+ CreateProtoServiceFunction(META_PROTO, PS_GETAVATARINFO, Meta_GetAvatarInfo);
CreateProtoServiceFunction(META_PROTO, PSS_GETINFO, Meta_GetInfo);
// receive filter
diff --git a/src/modules/metacontacts/meta_utils.cpp b/src/modules/metacontacts/meta_utils.cpp index eef6561c16..18a4c42078 100644 --- a/src/modules/metacontacts/meta_utils.cpp +++ b/src/modules/metacontacts/meta_utils.cpp @@ -191,13 +191,12 @@ BOOL Meta_Assign(MCONTACT hSub, MCONTACT hMeta, BOOL set_as_default) // if the new contact is the most online contact with avatar support, get avatar info
most_online = Meta_GetMostOnlineSupporting(ccDest, PFLAGNUM_4, PF4_AVATARS);
if (most_online == hSub) {
- PROTO_AVATAR_INFORMATIONT AI;
- AI.cbSize = sizeof(AI);
+ PROTO_AVATAR_INFORMATION AI;
AI.hContact = hMeta;
AI.format = PA_FORMAT_UNKNOWN;
_tcsncpy_s(AI.filename, _T("X"), _TRUNCATE);
- if (CallProtoService(META_PROTO, PS_GETAVATARINFOT, 0, (LPARAM)&AI) == GAIR_SUCCESS)
+ if (CallProtoService(META_PROTO, PS_GETAVATARINFO, 0, (LPARAM)&AI) == GAIR_SUCCESS)
db_set_ts(hMeta, "ContactPhoto", "File", AI.filename);
}
diff --git a/src/modules/protocols/protoaccs.cpp b/src/modules/protocols/protoaccs.cpp index 5e29c13b12..42e27aba15 100644 --- a/src/modules/protocols/protoaccs.cpp +++ b/src/modules/protocols/protoaccs.cpp @@ -291,45 +291,6 @@ int LoadAccountsModule(void) /////////////////////////////////////////////////////////////////////////////////////////
-static INT_PTR stub43(PROTO_INTERFACE* ppi, WPARAM wParam, LPARAM lParam)
-{
- PROTO_AVATAR_INFORMATION* p = (PROTO_AVATAR_INFORMATION*)lParam;
-
- PROTO_AVATAR_INFORMATIONW tmp = { 0 };
- tmp.cbSize = sizeof(tmp);
- tmp.hContact = p->hContact;
- int result = CallProtoServiceInt(NULL, ppi->m_szModuleName, PS_GETAVATARINFOW, wParam, (LPARAM)&tmp);
-
- p->format = tmp.format;
-
- wchar_t filename[MAX_PATH];
- mir_wstrcpy(filename, tmp.filename);
- GetShortPathNameW(tmp.filename, filename, SIZEOF(filename));
-
- WideCharToMultiByte(CP_ACP, 0, filename, -1, p->filename, MAX_PATH, 0, 0);
- return result;
-}
-
-static INT_PTR stub44(PROTO_INTERFACE* ppi, WPARAM wParam, LPARAM lParam)
-{
- wchar_t* buf = (wchar_t*)_alloca(sizeof(wchar_t) * (lParam + 1));
- int result = CallProtoServiceInt(NULL, ppi->m_szModuleName, PS_GETMYAVATARW, WPARAM(buf), lParam);
- if (result == 0) {
- wchar_t* filename = (wchar_t*)_alloca(sizeof(wchar_t) * (lParam + 1));
- mir_wstrcpy(filename, buf);
- GetShortPathNameW(buf, filename, lParam + 1);
-
- WideCharToMultiByte(CP_ACP, 0, filename, -1, (char*)wParam, lParam, 0, 0);
- }
-
- return result;
-}
-
-static INT_PTR stub45(PROTO_INTERFACE* ppi, WPARAM wParam, LPARAM lParam)
-{
- return CallProtoServiceInt(NULL, ppi->m_szModuleName, PS_SETMYAVATARW, wParam, _A2T((char*)lParam));
-}
-
static HANDLE CreateProtoServiceEx(const char* szModule, const char* szService, MIRANDASERVICEOBJ pFunc, void* param)
{
char tmp[100];
@@ -352,19 +313,6 @@ BOOL ActivateAccount(PROTOACCOUNT *pa) pa->ppro = ppi;
ppi->m_iDesiredStatus = ppi->m_iStatus = ID_STATUS_OFFLINE;
-
- if (!ProtoServiceExists(pa->szModuleName, PS_GETAVATARINFO))
- if (ProtoServiceExists(pa->szModuleName, PS_GETAVATARINFOW))
- CreateProtoServiceEx(pa->szModuleName, PS_GETAVATARINFO, (MIRANDASERVICEOBJ)stub43, pa->ppro);
-
- if (!ProtoServiceExists(pa->szModuleName, PS_GETMYAVATAR))
- if (ProtoServiceExists(pa->szModuleName, PS_GETMYAVATARW))
- CreateProtoServiceEx(pa->szModuleName, PS_GETMYAVATAR, (MIRANDASERVICEOBJ)stub44, pa->ppro);
-
- if (!ProtoServiceExists(pa->szModuleName, PS_SETMYAVATAR))
- if (ProtoServiceExists(pa->szModuleName, PS_SETMYAVATARW))
- CreateProtoServiceEx(pa->szModuleName, PS_SETMYAVATAR, (MIRANDASERVICEOBJ)stub45, pa->ppro);
-
return TRUE;
}
|