diff options
author | George Hazan <ghazan@miranda.im> | 2017-01-08 22:46:18 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2017-01-08 22:46:18 +0300 |
commit | 92f80d349f63f694d0fdcf003a852fd424557663 (patch) | |
tree | c3c65e956949cdd294c4fce32f696e1c811ec7de /plugins/AVS | |
parent | 82a3bbaf034bc286665465d8904e6d1db52e5eb4 (diff) |
unused ansi services removed
Diffstat (limited to 'plugins/AVS')
-rw-r--r-- | plugins/AVS/src/acc.h | 5 | ||||
-rw-r--r-- | plugins/AVS/src/options.cpp | 9 | ||||
-rw-r--r-- | plugins/AVS/src/services.cpp | 33 |
3 files changed, 13 insertions, 34 deletions
diff --git a/plugins/AVS/src/acc.h b/plugins/AVS/src/acc.h index 9917156385..94a8f1253a 100644 --- a/plugins/AVS/src/acc.h +++ b/plugins/AVS/src/acc.h @@ -21,10 +21,9 @@ Boston, MA 02111-1307, USA. #ifndef __ACC_H__
# define __ACC_H__
-static INT_PTR avSetAvatar(MCONTACT hContact, wchar_t *tszPath);
-INT_PTR avSetMyAvatar(char *szProto, wchar_t *tszPath);
+INT_PTR SetAvatar(WPARAM wParam, LPARAM lParam);
+INT_PTR SetMyAvatar(WPARAM wParam, LPARAM lParam);
int LoadACC();
-
#endif // __ACC_H__
diff --git a/plugins/AVS/src/options.cpp b/plugins/AVS/src/options.cpp index 48475ff1ad..b7304c11f5 100644 --- a/plugins/AVS/src/options.cpp +++ b/plugins/AVS/src/options.cpp @@ -30,7 +30,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define DM_PROTOCOLCHANGED (WM_USER + 13) extern int _DebugPopup(MCONTACT hContact, const char *fmt, ...); -extern INT_PTR SetAvatar(WPARAM wParam, LPARAM lParam); extern OBJLIST<protoPicCacheEntry> g_ProtoPictures; extern HANDLE hEventChanged; extern HINSTANCE g_hInst; @@ -1062,18 +1061,18 @@ static INT_PTR CALLBACK DlgProcAvatarProtoInfo(HWND hwndDlg, UINT msg, WPARAM wP switch (LOWORD(wParam)) { case IDC_CHANGE: if (BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_PER_PROTO)) - avSetMyAvatar(NULL, NULL); + SetMyAvatar(NULL, NULL); else { char *proto = GetSelectedProtocol(hwndDlg); if (proto != NULL) - avSetMyAvatar(proto, NULL); + SetMyAvatar((WPARAM)proto, NULL); } break; case IDC_DELETE: if (BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_PER_PROTO)) { if (MessageBox(hwndDlg, TranslateT("Are you sure you want to remove your avatar?"), TranslateT("Global avatar"), MB_YESNO) == IDYES) - avSetMyAvatar(NULL, L""); + SetMyAvatar(NULL, (LPARAM)L""); } else { char *proto = GetSelectedProtocol(hwndDlg); @@ -1084,7 +1083,7 @@ static INT_PTR CALLBACK DlgProcAvatarProtoInfo(HWND hwndDlg, UINT msg, WPARAM wP CallProtoService(proto, PS_GETNAME, _countof(description), (LPARAM)description); wchar_t *descr = mir_a2u(description); if (MessageBox(hwndDlg, TranslateT("Are you sure you want to remove your avatar?"), descr, MB_YESNO) == IDYES) - avSetMyAvatar(proto, L""); + SetMyAvatar((WPARAM)proto, (LPARAM)L""); mir_free(descr); } break; diff --git a/plugins/AVS/src/services.cpp b/plugins/AVS/src/services.cpp index aba7818492..754fa54dc7 100644 --- a/plugins/AVS/src/services.cpp +++ b/plugins/AVS/src/services.cpp @@ -115,7 +115,7 @@ UINT_PTR CALLBACK OpenFileSubclass(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP return FALSE;
}
-static INT_PTR avSetAvatar(MCONTACT hContact, wchar_t *tszPath)
+INT_PTR SetAvatar(WPARAM hContact, LPARAM lParam)
{
wchar_t FileName[MAX_PATH];
wchar_t *szFinalName;
@@ -126,6 +126,7 @@ static INT_PTR avSetAvatar(MCONTACT hContact, wchar_t *tszPath) int is_locked = db_get_b(hContact, "ContactPhoto", "Locked", 0);
+ wchar_t *tszPath = (wchar_t*)lParam;
if (tszPath == NULL) {
wchar_t filter[256];
Bitmap_GetFilter(filter, _countof(filter));
@@ -172,16 +173,6 @@ static INT_PTR avSetAvatar(MCONTACT hContact, wchar_t *tszPath) return 0;
}
-INT_PTR SetAvatar(WPARAM wParam, LPARAM lParam)
-{
- return avSetAvatar(wParam, _A2T((const char*)lParam));
-}
-
-INT_PTR SetAvatarW(WPARAM wParam, LPARAM lParam)
-{
- return avSetAvatar(wParam, (wchar_t*)lParam);
-}
-
/////////////////////////////////////////////////////////////////////////////////////////
// see if is possible to set the avatar for the expecified protocol
@@ -608,7 +599,7 @@ static int InternalSetMyAvatar(char *protocol, wchar_t *szFinalName, SetMyAvatar return ret;
}
-INT_PTR avSetMyAvatar(char* protocol, wchar_t* tszPath)
+INT_PTR SetMyAvatar(WPARAM wParam, LPARAM lParam)
{
wchar_t FileName[MAX_PATH];
wchar_t *szFinalName = NULL;
@@ -616,9 +607,11 @@ INT_PTR avSetMyAvatar(char* protocol, wchar_t* tszPath) BOOL allAcceptSWF;
// Protocol allow seting of avatar?
+ char* protocol = (char*)wParam;
if (protocol != NULL && !CanSetMyAvatar((WPARAM)protocol, 0))
return -1;
+ wchar_t* tszPath = (wchar_t*)lParam;
if (tszPath == NULL && hwndSetMyAvatar != 0) {
SetForegroundWindow(hwndSetMyAvatar);
SetFocus(hwndSetMyAvatar);
@@ -707,16 +700,6 @@ INT_PTR avSetMyAvatar(char* protocol, wchar_t* tszPath) return InternalSetMyAvatar(protocol, szFinalName, data, allAcceptXML, allAcceptSWF);
}
-static INT_PTR SetMyAvatar(WPARAM wParam, LPARAM lParam)
-{
- return avSetMyAvatar((char*)wParam, _A2T((const char*)lParam));
-}
-
-static INT_PTR SetMyAvatarW(WPARAM wParam, LPARAM lParam)
-{
- return avSetMyAvatar((char*)wParam, (wchar_t*)lParam);
-}
-
/////////////////////////////////////////////////////////////////////////////////////////
INT_PTR CALLBACK DlgProcAvatarOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
@@ -859,10 +842,8 @@ void InitServices() {
CreateServiceFunction(MS_AV_GETAVATARBITMAP, GetAvatarBitmap);
CreateServiceFunction(MS_AV_PROTECTAVATAR, ProtectAvatar);
- CreateServiceFunction(MS_AV_SETAVATAR, SetAvatar);
- CreateServiceFunction(MS_AV_SETAVATARW, SetAvatarW);
- CreateServiceFunction(MS_AV_SETMYAVATAR, SetMyAvatar);
- CreateServiceFunction(MS_AV_SETMYAVATARW, SetMyAvatarW);
+ CreateServiceFunction(MS_AV_SETAVATARW, SetAvatar);
+ CreateServiceFunction(MS_AV_SETMYAVATARW, SetMyAvatar);
CreateServiceFunction(MS_AV_CANSETMYAVATAR, CanSetMyAvatar);
CreateServiceFunction(MS_AV_CONTACTOPTIONS, ContactOptions);
CreateServiceFunction(MS_AV_DRAWAVATAR, DrawAvatarPicture);
|