diff options
author | George Hazan <george.hazan@gmail.com> | 2012-06-06 08:16:09 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2012-06-06 08:16:09 +0000 |
commit | a4c70f6bedb25e5cffb08dfc5cbc2597d1642d6b (patch) | |
tree | 20db522d4733f5e50e00f78b82e75f2b7671789c /plugins | |
parent | 721f5bbb2a8e903e7793434c4f2430f49c5036dc (diff) |
oops :)
git-svn-id: http://svn.miranda-ng.org/main/trunk@326 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/Twitter/chat.cpp | 2 | ||||
-rw-r--r-- | plugins/Twitter/connection.cpp | 7 | ||||
-rw-r--r-- | plugins/Twitter/http.cpp | 4 | ||||
-rw-r--r-- | plugins/Twitter/proto.h | 2 | ||||
-rw-r--r-- | plugins/Twitter/twitter.h | 9 | ||||
-rw-r--r-- | plugins/Twitter/twitter.vcxproj | 2 |
6 files changed, 16 insertions, 10 deletions
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<DWORD>(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 <http://www.gnu.org/licenses/>. #include "http.h"
#include <tchar.h>
-#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 @@ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
- <CharacterSet>MultiByte</CharacterSet>
+ <CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|