summaryrefslogtreecommitdiff
path: root/protocols/JabberG/src/jabber_iq_handlers.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2017-02-03 16:08:38 +0300
committerGeorge Hazan <ghazan@miranda.im>2017-02-03 16:08:38 +0300
commit1ef4b90ce07ccc4e372f0b8179c69438bff24ae2 (patch)
treeeb9cda4038333ff654e4da664325569d493c9648 /protocols/JabberG/src/jabber_iq_handlers.cpp
parentceb375ad7f99c4169ffb3041037583996122fa57 (diff)
mime type standardization
Diffstat (limited to 'protocols/JabberG/src/jabber_iq_handlers.cpp')
-rw-r--r--protocols/JabberG/src/jabber_iq_handlers.cpp11
1 files changed, 3 insertions, 8 deletions
diff --git a/protocols/JabberG/src/jabber_iq_handlers.cpp b/protocols/JabberG/src/jabber_iq_handlers.cpp
index 924b335afc..e532340acc 100644
--- a/protocols/JabberG/src/jabber_iq_handlers.cpp
+++ b/protocols/JabberG/src/jabber_iq_handlers.cpp
@@ -151,14 +151,9 @@ BOOL CJabberProto::OnIqRequestAvatar(HXML, CJabberIqInfo *pInfo)
if (pictureType == PA_FORMAT_UNKNOWN)
return TRUE;
- wchar_t *szMimeType;
- switch (pictureType) {
- case PA_FORMAT_JPEG: szMimeType = L"image/jpeg"; break;
- case PA_FORMAT_GIF: szMimeType = L"image/gif"; break;
- case PA_FORMAT_PNG: szMimeType = L"image/png"; break;
- case PA_FORMAT_BMP: szMimeType = L"image/bmp"; break;
- default: return TRUE;
- }
+ const wchar_t *szMimeType = ProtoGetAvatarMimeType(pictureType);
+ if (szMimeType == NULL)
+ return TRUE;
wchar_t szFileName[MAX_PATH];
GetAvatarFileName(NULL, szFileName, _countof(szFileName));