summaryrefslogtreecommitdiff
path: root/protocols/Skype/src/skype_utils.cpp
diff options
context:
space:
mode:
authorAlexander Lantsev <aunsane@gmail.com>2013-04-20 10:14:05 +0000
committerAlexander Lantsev <aunsane@gmail.com>2013-04-20 10:14:05 +0000
commit5560fccb85a89bb668a79eed3d4cd0e668278331 (patch)
treea8c5949d9cc473c51af2712bb79c306f4a531932 /protocols/Skype/src/skype_utils.cpp
parent5a5ffa5cc195669c48827e4cf9d948dfb3272e47 (diff)
- temporary commit. may contain non-working code
git-svn-id: http://svn.miranda-ng.org/main/trunk@4480 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Skype/src/skype_utils.cpp')
-rw-r--r--protocols/Skype/src/skype_utils.cpp28
1 files changed, 26 insertions, 2 deletions
diff --git a/protocols/Skype/src/skype_utils.cpp b/protocols/Skype/src/skype_utils.cpp
index acc1ef33c5..4cb81a5c50 100644
--- a/protocols/Skype/src/skype_utils.cpp
+++ b/protocols/Skype/src/skype_utils.cpp
@@ -507,7 +507,7 @@ void CSkypeProto::ShowNotification(const wchar_t *message, int flags, HANDLE hCo
CSkypeProto::ShowNotification(TranslateT("Skype Protocol"), message, flags, hContact);
}
-char *CSkypeProto::RemoveHtml(char *text)
+char *CSkypeProto::RemoveHtml(const char *text)
{
std::string new_string = "";
std::string data = text;
@@ -551,7 +551,6 @@ char *CSkypeProto::RemoveHtml(char *text)
new_string += data.at(i);
}
- ::mir_free(text);
return ::mir_strdup(new_string.c_str());
}
@@ -617,4 +616,29 @@ CContact::AVAILABILITY CSkypeProto::MirandaToSkypeStatus(int status)
}
return availability;
+}
+
+SEBinary CSkypeProto::GetAvatarBinary(wchar_t *path)
+{
+ SEBinary avatar;
+
+ if (::PathFileExists(path))
+ {
+ int len;
+ char *buffer;
+ FILE* fp = ::_wfopen(path, L"rb");
+ if (fp)
+ {
+ ::fseek(fp, 0, SEEK_END);
+ len = ::ftell(fp);
+ ::fseek(fp, 0, SEEK_SET);
+ buffer = new char[len + 1];
+ ::fread(buffer, len, 1, fp);
+ ::fclose(fp);
+
+ avatar.set(buffer, len);
+ }
+ }
+
+ return avatar;
} \ No newline at end of file