From 3ad0e7bcb4d239cdc7d1eba66c13318b8d4d6895 Mon Sep 17 00:00:00 2001 From: MikalaiR Date: Sat, 29 Aug 2015 19:50:22 +0000 Subject: Toaster: reverted :-( git-svn-id: http://svn.miranda-ng.org/main/trunk@15105 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Toaster/src/avatars.cpp | 2 -- plugins/Toaster/src/avatars.h | 28 ---------------------------- plugins/Toaster/src/main.cpp | 2 -- plugins/Toaster/src/services.cpp | 10 ---------- plugins/Toaster/src/stdafx.h | 4 ---- 5 files changed, 46 deletions(-) delete mode 100644 plugins/Toaster/src/avatars.cpp delete mode 100644 plugins/Toaster/src/avatars.h (limited to 'plugins/Toaster/src') diff --git a/plugins/Toaster/src/avatars.cpp b/plugins/Toaster/src/avatars.cpp deleted file mode 100644 index 716dda68f1..0000000000 --- a/plugins/Toaster/src/avatars.cpp +++ /dev/null @@ -1,2 +0,0 @@ -#include "stdafx.h" - diff --git a/plugins/Toaster/src/avatars.h b/plugins/Toaster/src/avatars.h deleted file mode 100644 index 9321b6bfbf..0000000000 --- a/plugins/Toaster/src/avatars.h +++ /dev/null @@ -1,28 +0,0 @@ -class ToasterAvatar -{ - ptrW wszPath; - int iFormat; - MCONTACT hContact; - FIBITMAP *bitmap; - -public: - ToasterAvatar(PROTO_AVATAR_INFORMATION *pai) : wszPath(pai->filename), iFormat(pai->format), hContact(pai->hContact) - { - bitmap = (FIBITMAP*)CallService(MS_IMG_LOAD, (WPARAM)wszPath, IMGL_WCHAR | IMGL_RETURNDIB); - } - - ~ToasterAvatar() - { - CallService(MS_IMG_UNLOAD, (WPARAM)bitmap); - } - - INT_PTR Save(const wchar_t *wszSavePath) - { - IMGSRVC_INFO isi = { sizeof(isi) }; - isi.wszName = mir_wstrdup(wszSavePath); - isi.dib = bitmap; - isi.dwMask = IMGI_FBITMAP; - isi.fif = FREE_IMAGE_FORMAT::FIF_PNG; - return CallService(MS_IMG_SAVE, (WPARAM)&isi, IMGL_WCHAR); - } -}; \ No newline at end of file diff --git a/plugins/Toaster/src/main.cpp b/plugins/Toaster/src/main.cpp index eb8a9e50f1..ccfedcefa1 100644 --- a/plugins/Toaster/src/main.cpp +++ b/plugins/Toaster/src/main.cpp @@ -3,7 +3,6 @@ int hLangpack; HINSTANCE g_hInstance; -HANDLE g_hTempAvatarsFolder; PLUGININFOEX pluginInfo = { @@ -41,7 +40,6 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD) extern "C" int __declspec(dllexport) Load(void) { mir_getLP(&pluginInfo); - g_hTempAvatarsFolder = FoldersRegisterCustomPathT(MODULE, Translate("Temp avatars"), VARSW(L"%miranda_userdata%\\Temp")); HookEvent(ME_SYSTEM_PRESHUTDOWN, &OnPreShutdown); InitServices(); diff --git a/plugins/Toaster/src/services.cpp b/plugins/Toaster/src/services.cpp index 323eb50b72..03475b5f38 100644 --- a/plugins/Toaster/src/services.cpp +++ b/plugins/Toaster/src/services.cpp @@ -46,16 +46,6 @@ static void ShowToastNotification(TCHAR* text, TCHAR* title, MCONTACT hContact) PROTO_AVATAR_INFORMATION pai = { 0 }; pai.hContact = hContact; CallProtoService(szProto, PS_GETAVATARINFO, (WPARAM)0, (LPARAM)&pai); - if (pai.format != PA_FORMAT_PNG) - { - wchar_t dir[MAX_PATH]; - FoldersGetCustomPathT(g_hTempAvatarsFolder, dir, _countof(dir), VARSW(L"%miranda_userdata%\\Temp")); - ToasterAvatar *ta = new ToasterAvatar(&pai); - CMStringW wszPath(FORMAT, L"%s\\%lld.%d.png", dir, hContact, db_get_dw(hContact, "ContactPhoto", "ImageHash")); - ta->Save(wszPath); - imagePath = wszPath.Detach(); - delete ta; - } imagePath = pai.filename[0] ? mir_tstrdup(pai.filename) : nullptr; } } diff --git a/plugins/Toaster/src/stdafx.h b/plugins/Toaster/src/stdafx.h index 01c4b0e0d6..d198146e97 100644 --- a/plugins/Toaster/src/stdafx.h +++ b/plugins/Toaster/src/stdafx.h @@ -16,8 +16,6 @@ #include #include #include -#include -#include #include "version.h" #include "resource.h" @@ -32,12 +30,10 @@ DEFINE_PROPERTYKEY(PKEY_AppUserModel_ID, 0x9F4C2855, 0x9F79, 0x4B39, 0xA8, 0xD0, #include "toast_event_handler.h" #include "toast_notification.h" #include "add_to_start_menu.h" -#include "avatars.h" extern HINSTANCE g_hInstance; extern mir_cs csNotifications; extern OBJLIST lstNotifications; -extern HANDLE g_hTempAvatarsFolder; struct callbackArg { -- cgit v1.2.3