diff options
author | George Hazan <ghazan@miranda.im> | 2017-02-03 16:08:38 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2017-02-03 16:08:38 +0300 |
commit | 1ef4b90ce07ccc4e372f0b8179c69438bff24ae2 (patch) | |
tree | eb9cda4038333ff654e4da664325569d493c9648 /protocols/JabberG/src/jabber_util.cpp | |
parent | ceb375ad7f99c4169ffb3041037583996122fa57 (diff) |
mime type standardization
Diffstat (limited to 'protocols/JabberG/src/jabber_util.cpp')
-rw-r--r-- | protocols/JabberG/src/jabber_util.cpp | 14 |
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));
}
/////////////////////////////////////////////////////////////////////////////////////////
|