diff options
author | Kirill Volinsky <mataes2007@gmail.com> | 2012-12-23 19:45:46 +0000 |
---|---|---|
committer | Kirill Volinsky <mataes2007@gmail.com> | 2012-12-23 19:45:46 +0000 |
commit | afc16fc2d120e780220cddc03350122ad8e672fc (patch) | |
tree | 5ba0b1bb3ced704a516e0c1df59a1e736aa2e334 /protocols/Skype/src/skype_utils.cpp | |
parent | 5dec14aae90a4ea4f16a6e2b57d52375599b90c0 (diff) |
remove html tags (thx Robyer)
git-svn-id: http://svn.miranda-ng.org/main/trunk@2819 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Skype/src/skype_utils.cpp')
-rw-r--r-- | protocols/Skype/src/skype_utils.cpp | 100 |
1 files changed, 74 insertions, 26 deletions
diff --git a/protocols/Skype/src/skype_utils.cpp b/protocols/Skype/src/skype_utils.cpp index 5fdcb0dff1..008f295cae 100644 --- a/protocols/Skype/src/skype_utils.cpp +++ b/protocols/Skype/src/skype_utils.cpp @@ -1,32 +1,32 @@ #include "skype_proto.h"
wchar_t* CSkypeProto::LogoutReasons[] =
-{ - LPGENW("LOGOUT_CALLED") /* LOGOUT_CALLED */, - LPGENW("HTTPS_PROXY_AUTH_FAILED") /* HTTPS_PROXY_AUTH_FAILED */, - LPGENW("SOCKS_PROXY_AUTH_FAILED") /* SOCKS_PROXY_AUTH_FAILED */, - LPGENW("P2P_CONNECT_FAILED") /* P2P_CONNECT_FAILED */, - LPGENW("SERVER_CONNECT_FAILED") /* SERVER_CONNECT_FAILED */, - LPGENW("SERVER_OVERLOADED") /* SERVER_OVERLOADED */, - LPGENW("DB_IN_USE") /* DB_IN_USE */, - LPGENW("Invalid skypename") /* INVALID_SKYPENAME */, - LPGENW("Invalid email") /* INVALID_EMAIL */, - LPGENW("Unacceptable password") /* UNACCEPTABLE_PASSWORD */, - LPGENW("SKYPENAME_TAKEN") /* SKYPENAME_TAKEN */, - LPGENW("REJECTED_AS_UNDERAGE") /* REJECTED_AS_UNDERAGE */, - LPGENW("NO_SUCH_IDENTITY") /* NO_SUCH_IDENTITY */, - LPGENW("Incorrect password") /* INCORRECT_PASSWORD */, - LPGENW("Too many login attempts") /* TOO_MANY_LOGIN_ATTEMPTS */, - LPGENW("PASSWORD_HAS_CHANGED") /* PASSWORD_HAS_CHANGED */, - LPGENW("PERIODIC_UIC_UPDATE_FAILED") /* PERIODIC_UIC_UPDATE_FAILED */, - LPGENW("DB_DISK_FULL") /* DB_DISK_FULL */, - LPGENW("DB_IO_ERROR") /* DB_IO_ERROR */, - LPGENW("DB_CORRUPT") /* DB_CORRUPT */, - LPGENW("DB_FAILURE") /* DB_FAILURE */, - LPGENW("INVALID_APP_ID") /* INVALID_APP_ID */, - LPGENW("APP_ID_FAILURE") /* APP_ID_FAILURE */, - LPGENW("UNSUPPORTED_VERSION") /* UNSUPPORTED_VERSION */, - LPGENW("ATO (Account TakeOver) detected, account blocked") /* ATO_BLOCKED */, +{
+ LPGENW("LOGOUT_CALLED") /* LOGOUT_CALLED */,
+ LPGENW("HTTPS_PROXY_AUTH_FAILED") /* HTTPS_PROXY_AUTH_FAILED */,
+ LPGENW("SOCKS_PROXY_AUTH_FAILED") /* SOCKS_PROXY_AUTH_FAILED */,
+ LPGENW("P2P_CONNECT_FAILED") /* P2P_CONNECT_FAILED */,
+ LPGENW("SERVER_CONNECT_FAILED") /* SERVER_CONNECT_FAILED */,
+ LPGENW("SERVER_OVERLOADED") /* SERVER_OVERLOADED */,
+ LPGENW("DB_IN_USE") /* DB_IN_USE */,
+ LPGENW("Invalid skypename") /* INVALID_SKYPENAME */,
+ LPGENW("Invalid email") /* INVALID_EMAIL */,
+ LPGENW("Unacceptable password") /* UNACCEPTABLE_PASSWORD */,
+ LPGENW("SKYPENAME_TAKEN") /* SKYPENAME_TAKEN */,
+ LPGENW("REJECTED_AS_UNDERAGE") /* REJECTED_AS_UNDERAGE */,
+ LPGENW("NO_SUCH_IDENTITY") /* NO_SUCH_IDENTITY */,
+ LPGENW("Incorrect password") /* INCORRECT_PASSWORD */,
+ LPGENW("Too many login attempts") /* TOO_MANY_LOGIN_ATTEMPTS */,
+ LPGENW("PASSWORD_HAS_CHANGED") /* PASSWORD_HAS_CHANGED */,
+ LPGENW("PERIODIC_UIC_UPDATE_FAILED") /* PERIODIC_UIC_UPDATE_FAILED */,
+ LPGENW("DB_DISK_FULL") /* DB_DISK_FULL */,
+ LPGENW("DB_IO_ERROR") /* DB_IO_ERROR */,
+ LPGENW("DB_CORRUPT") /* DB_CORRUPT */,
+ LPGENW("DB_FAILURE") /* DB_FAILURE */,
+ LPGENW("INVALID_APP_ID") /* INVALID_APP_ID */,
+ LPGENW("APP_ID_FAILURE") /* APP_ID_FAILURE */,
+ LPGENW("UNSUPPORTED_VERSION") /* UNSUPPORTED_VERSION */,
+ LPGENW("ATO (Account TakeOver) detected, account blocked") /* ATO_BLOCKED */,
LPGENW("Logout from another instance") /* REMOTE_LOGOUT */,
LPGENW("") /* ACCESS_TOKEN_RENEWAL_FAILED */
};
@@ -524,4 +524,52 @@ ULONG CSkypeProto::Base64Encode(char *inputString, char *outputBuffer, SIZE_T nM outputBuffer[outpos] = 0;
return outpos;
+}
+
+char *CSkypeProto::RemoveHtml(char *text)
+{
+ std::string new_string = "";
+ std::string data = text;
+
+ for (std::string::size_type i = 0; i < data.length(); i++)
+ {
+ if (data.at(i) == '<' && data.at(i+1) != ' ')
+ {
+ i = data.find(">", i);
+ if (i == std::string::npos)
+ break;
+
+ continue;
+ }
+
+ if (data.at(i) == '&') {
+ std::string::size_type begin = i;
+ i = data.find(";", i);
+ if (i == std::string::npos) {
+ i = begin;
+ } else {
+ std::string entity = data.substr(begin+1, i-begin-1);
+
+ bool found = false;
+ for (int j=0; j<SIZEOF(htmlEntities); j++)
+ {
+ if (!stricmp(entity.c_str(), htmlEntities[j].entity)) {
+ new_string += htmlEntities[j].symbol;
+ found = true;
+ break;
+ }
+ }
+
+ if (found)
+ continue;
+ else
+ i = begin;
+ }
+ }
+
+ new_string += data.at(i);
+ }
+
+ ::mir_free(text);
+ return ::mir_strdup(new_string.c_str());
}
\ No newline at end of file |