summaryrefslogtreecommitdiff
path: root/protocols/JabberG/src/jabber_iq_handlers.cpp
diff options
context:
space:
mode:
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));