From 1ef4b90ce07ccc4e372f0b8179c69438bff24ae2 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 3 Feb 2017 16:08:38 +0300 Subject: mime type standardization --- protocols/Tlen/src/tlen_avatar.cpp | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) (limited to 'protocols/Tlen') diff --git a/protocols/Tlen/src/tlen_avatar.cpp b/protocols/Tlen/src/tlen_avatar.cpp index bd9c031b3a..3689a8bb75 100644 --- a/protocols/Tlen/src/tlen_avatar.cpp +++ b/protocols/Tlen/src/tlen_avatar.cpp @@ -274,22 +274,9 @@ static void TlenGetAvatarThread(void *ptr) if (resp != NULL) { if (resp->resultCode/100 == 2) { if (resp->dataLength > 0) { - int i; - for (i=0; iheadersCount; i++ ) { + for (int i=0; iheadersCount; i++ ) { if (!strcmpi(resp->headers[i].szName, "Content-Type")) { - if (!strcmpi(resp->headers[i].szValue, "image/png")) - format = PA_FORMAT_PNG; - else if (!strcmpi(resp->headers[i].szValue, "image/x-png")) - format = PA_FORMAT_PNG; - else if (!strcmpi(resp->headers[i].szValue, "image/jpeg")) - format = PA_FORMAT_JPEG; - else if (!strcmpi(resp->headers[i].szValue, "image/jpg")) - format = PA_FORMAT_JPEG; - else if (!strcmpi(resp->headers[i].szValue, "image/gif")) - format = PA_FORMAT_GIF; - else if (!strcmpi(resp->headers[i].szValue, "image/bmp")) - format = PA_FORMAT_BMP; - + format = ProtoGetAvatarFormatByMimeType(_A2T(resp->headers[i].szValue)); break; } } -- cgit v1.2.3