summaryrefslogtreecommitdiff
path: root/protocols/Twitter
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/Twitter')
-rw-r--r--protocols/Twitter/src/connection.cpp2
-rw-r--r--protocols/Twitter/src/utility.cpp24
-rw-r--r--protocols/Twitter/src/utility.h1
3 files changed, 1 insertions, 26 deletions
diff --git a/protocols/Twitter/src/connection.cpp b/protocols/Twitter/src/connection.cpp
index d9a7dc704b..bf51ca0687 100644
--- a/protocols/Twitter/src/connection.cpp
+++ b/protocols/Twitter/src/connection.cpp
@@ -426,7 +426,7 @@ void TwitterProto::UpdateAvatarWorker(void *p)
PROTO_AVATAR_INFORMATIONT ai = {sizeof(ai)};
ai.hContact = data->hContact;
- ai.format = ext_to_format(ext);
+ ai.format = ProtoGetAvatarFormat(filename.c_str());
if (ai.format == PA_FORMAT_UNKNOWN) {
LOG( _T("***** Update avatar: Terminated for this contact, extension format unknown for %s"), data->url.c_str());
diff --git a/protocols/Twitter/src/utility.cpp b/protocols/Twitter/src/utility.cpp
index 219b8e1ec4..2a245455be 100644
--- a/protocols/Twitter/src/utility.cpp
+++ b/protocols/Twitter/src/utility.cpp
@@ -195,27 +195,3 @@ bool save_url(HANDLE hNetlib,const std::string &url,const std::tstring &filename
else
return false;
}
-
-static const struct
-{
- char *ext;
- int fmt;
-} formats[] = {
- { ".png", PA_FORMAT_PNG },
- { ".jpg", PA_FORMAT_JPEG },
- { ".jpeg", PA_FORMAT_JPEG },
- { ".ico", PA_FORMAT_ICON },
- { ".bmp", PA_FORMAT_BMP },
- { ".gif", PA_FORMAT_GIF },
-};
-
-int ext_to_format(const std::string &ext)
-{
- for(size_t i=0; i<SIZEOF(formats); i++)
- {
- if(ext == formats[i].ext)
- return formats[i].fmt;
- }
-
- return PA_FORMAT_UNKNOWN;
-} \ No newline at end of file
diff --git a/protocols/Twitter/src/utility.h b/protocols/Twitter/src/utility.h
index 17aa1cb649..c8f862e247 100644
--- a/protocols/Twitter/src/utility.h
+++ b/protocols/Twitter/src/utility.h
@@ -125,5 +125,4 @@ private:
HANDLE handle_;
};
-int ext_to_format(const std::string &ext);
bool save_url(HANDLE hNetlib,const std::string &url,const std::tstring &filename); \ No newline at end of file