summaryrefslogtreecommitdiff
path: root/protocols/JabberG/src/jabber_util.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_util.cpp
parentceb375ad7f99c4169ffb3041037583996122fa57 (diff)
mime type standardization
Diffstat (limited to 'protocols/JabberG/src/jabber_util.cpp')
-rw-r--r--protocols/JabberG/src/jabber_util.cpp14
1 files changed, 2 insertions, 12 deletions
diff --git a/protocols/JabberG/src/jabber_util.cpp b/protocols/JabberG/src/jabber_util.cpp
index c1fb18a4e2..19de86f090 100644
--- a/protocols/JabberG/src/jabber_util.cpp
+++ b/protocols/JabberG/src/jabber_util.cpp
@@ -587,20 +587,10 @@ wchar_t* __stdcall JabberStripJid(const wchar_t *jid, wchar_t *dest, size_t dest
LPCTSTR __stdcall JabberGetPictureType(HXML node, const char *picBuf)
{
if (LPCTSTR ptszType = XmlGetText(XmlGetChild(node, "TYPE")))
- if (!mir_wstrcmp(ptszType, L"image/jpeg") ||
- !mir_wstrcmp(ptszType, L"image/png") ||
- !mir_wstrcmp(ptszType, L"image/gif") ||
- !mir_wstrcmp(ptszType, L"image/bmp"))
+ if (ProtoGetAvatarFormatByMimeType(ptszType) != PA_FORMAT_UNKNOWN)
return ptszType;
- switch (ProtoGetBufferFormat(picBuf)) {
- case PA_FORMAT_GIF: return L"image/gif";
- case PA_FORMAT_BMP: return L"image/bmp";
- case PA_FORMAT_PNG: return L"image/png";
- case PA_FORMAT_JPEG: return L"image/jpeg";
- }
-
- return NULL;
+ return ProtoGetAvatarMimeType(ProtoGetBufferFormat(picBuf));
}
/////////////////////////////////////////////////////////////////////////////////////////