From a4c70f6bedb25e5cffb08dfc5cbc2597d1642d6b Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 6 Jun 2012 08:16:09 +0000 Subject: oops :) git-svn-id: http://svn.miranda-ng.org/main/trunk@326 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Twitter/chat.cpp | 2 +- plugins/Twitter/connection.cpp | 7 ++----- plugins/Twitter/http.cpp | 4 +++- plugins/Twitter/proto.h | 2 +- plugins/Twitter/twitter.h | 9 ++++++++- plugins/Twitter/twitter.vcxproj | 2 +- 6 files changed, 16 insertions(+), 10 deletions(-) (limited to 'plugins') diff --git a/plugins/Twitter/chat.cpp b/plugins/Twitter/chat.cpp index 46496259f2..4e659c2aa8 100644 --- a/plugins/Twitter/chat.cpp +++ b/plugins/Twitter/chat.cpp @@ -33,7 +33,7 @@ void TwitterProto::UpdateChat(const twitter_user &update) gce.pDest = &gcd; gce.ptszUID = mir_a2t( update.username.c_str()); gce.bIsMe = (update.username == twit_.get_username()); - gce.ptszText = update.status.text.c_str(); + gce.ptszText = ( TCHAR* )update.status.text.c_str(); gce.time = static_cast(update.status.time); DBVARIANT nick; diff --git a/plugins/Twitter/connection.cpp b/plugins/Twitter/connection.cpp index 18715e5b84..83660a8256 100644 --- a/plugins/Twitter/connection.cpp +++ b/plugins/Twitter/connection.cpp @@ -307,13 +307,10 @@ void TwitterProto::UpdateFriends() } -void TwitterProto::ShowContactPopup(HANDLE hContact, const std::wstring &text) +void TwitterProto::ShowContactPopup(HANDLE hContact, const std::tstring &text) { - if (!ServiceExists(MS_POPUP_ADDPOPUPT) || DBGetContactSettingByte(0, - m_szModuleName, TWITTER_KEY_POPUP_SHOW, 0) == 0) - { + if (!ServiceExists(MS_POPUP_ADDPOPUPT) || DBGetContactSettingByte(0, m_szModuleName, TWITTER_KEY_POPUP_SHOW, 0) == 0) return; - } POPUPDATAT popup = {}; popup.lchContact = hContact; diff --git a/plugins/Twitter/http.cpp b/plugins/Twitter/http.cpp index aaf9210ac4..63218ca616 100644 --- a/plugins/Twitter/http.cpp +++ b/plugins/Twitter/http.cpp @@ -29,7 +29,9 @@ std::string http::url_encode(const std::string &s) std::string http::url_encode(const std::wstring &s) { - char *encoded = (char*)CallService( MS_NETLIB_URLENCODE, 0, ( LPARAM )( char* )_T2A(s.c_str())); + char* data = mir_u2a( s.c_str()); + char *encoded = (char*)CallService( MS_NETLIB_URLENCODE, 0, ( LPARAM )data); + mir_free( data ); std::string ret = encoded; HeapFree(GetProcessHeap(),0,encoded); diff --git a/plugins/Twitter/proto.h b/plugins/Twitter/proto.h index 82d02e6c18..af7a43d321 100644 --- a/plugins/Twitter/proto.h +++ b/plugins/Twitter/proto.h @@ -133,7 +133,7 @@ private: void ShowPopup(const wchar_t *); void ShowPopup(const char *); - void ShowContactPopup(HANDLE, const std::wstring &); + void ShowContactPopup(HANDLE, const std::tstring &); bool IsMyContact(HANDLE, bool include_chat = false); HANDLE UsernameToHContact(const TCHAR *); diff --git a/plugins/Twitter/twitter.h b/plugins/Twitter/twitter.h index cf60265152..06f8aca954 100644 --- a/plugins/Twitter/twitter.h +++ b/plugins/Twitter/twitter.h @@ -24,7 +24,14 @@ along with this program. If not, see . #include "http.h" #include -#define tstring wstring +#if !defined(tstring) + #ifdef _UNICODE + #define tstring wstring + #else + #define tstring string + #endif +#endif + typedef unsigned long long twitter_id; struct twitter_status diff --git a/plugins/Twitter/twitter.vcxproj b/plugins/Twitter/twitter.vcxproj index 0bfbabcd7a..54d1255118 100644 --- a/plugins/Twitter/twitter.vcxproj +++ b/plugins/Twitter/twitter.vcxproj @@ -18,7 +18,7 @@ DynamicLibrary - MultiByte + Unicode true -- cgit v1.2.3