summaryrefslogtreecommitdiff
path: root/protocols/Gadu-Gadu
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-03-07 23:38:31 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-03-07 23:38:31 +0300
commit777dc2174f34c2a4d4499c3d63ef8914ed9ecb81 (patch)
tree6d7c6c4b09287386739ba4cc7accde38ed90da8c /protocols/Gadu-Gadu
parente9e0d8203c36c1d2e2aa4201e01bf4206804f25b (diff)
old AdvaImg services converted into Image_* functions
Diffstat (limited to 'protocols/Gadu-Gadu')
-rw-r--r--protocols/Gadu-Gadu/src/image.cpp15
-rw-r--r--protocols/Gadu-Gadu/src/token.cpp10
2 files changed, 5 insertions, 20 deletions
diff --git a/protocols/Gadu-Gadu/src/image.cpp b/protocols/Gadu-Gadu/src/image.cpp
index 23c485b2ad..38540c4620 100644
--- a/protocols/Gadu-Gadu/src/image.cpp
+++ b/protocols/Gadu-Gadu/src/image.cpp
@@ -1054,19 +1054,10 @@ void* GaduProto::img_loadpicture(gg_event* e, wchar_t *szFileName)
////////////////////////////////////////////////////////////////////
// Loading picture using Miranda Image services
- // Load image from memory
- if (!szFileName)
- {
- IMGSRVC_MEMIO memio;
- memio.iLen = dat->nSize;
- memio.pBuf = (void *)dat->lpData;
- memio.fif = FIF_UNKNOWN; /* detect */
- memio.flags = 0;
- dat->hBitmap = (HBITMAP)CallService(MS_IMG_LOADFROMMEM, (WPARAM)&memio, 0);
- }
- // Load image from file
+ if (!szFileName) // Load image from memory
+ dat->hBitmap = Image_LoadFromMem(dat->lpData, dat->nSize, FIF_UNKNOWN);
else
- dat->hBitmap = Bitmap_Load(szFileName);
+ dat->hBitmap = Bitmap_Load(szFileName); // Load image from file
// If everything is fine return the handle
if (dat->hBitmap)
diff --git a/protocols/Gadu-Gadu/src/token.cpp b/protocols/Gadu-Gadu/src/token.cpp
index d38435afa2..ebb9535726 100644
--- a/protocols/Gadu-Gadu/src/token.cpp
+++ b/protocols/Gadu-Gadu/src/token.cpp
@@ -137,14 +137,8 @@ int GaduProto::gettoken(GGTOKEN *token)
dat.height = t->height;
// Load bitmap
- IMGSRVC_MEMIO memio = { 0 };
- memio.iLen = h->body_size;
- memio.pBuf = h->body;
- memio.fif = FIF_UNKNOWN; /* detect */
- memio.flags = 0;
- dat.hBitmap = (HBITMAP)CallService(MS_IMG_LOADFROMMEM, (WPARAM)&memio, 0);
- if (dat.hBitmap == nullptr)
- {
+ dat.hBitmap = Image_LoadFromMem(h->body, h->body_size, FIF_UNKNOWN);
+ if (dat.hBitmap == nullptr) {
MessageBox(nullptr, TranslateT("Could not load token image."), m_tszUserName, MB_OK | MB_ICONSTOP);
gg_free_pubdir(h);
return FALSE;