summaryrefslogtreecommitdiff
path: root/protocols/Yahoo
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-04-20 14:25:52 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-04-20 14:25:52 +0000
commita346491026d5df1ffe0d41e4881613a47ca6ca47 (patch)
treeffd505fe0680db47ea51549ec3565e23f56e34a1 /protocols/Yahoo
parent2ffa7047ec0475856481b9e813eecb99b268d2d0 (diff)
end of the city legend that PSS_MESSAGEW ever existed
git-svn-id: http://svn.miranda-ng.org/main/trunk@4482 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Yahoo')
-rw-r--r--protocols/Yahoo/src/im.cpp23
1 files changed, 6 insertions, 17 deletions
diff --git a/protocols/Yahoo/src/im.cpp b/protocols/Yahoo/src/im.cpp
index 4892832ed0..a0c44aa7d3 100644
--- a/protocols/Yahoo/src/im.cpp
+++ b/protocols/Yahoo/src/im.cpp
@@ -175,38 +175,27 @@ void __cdecl CYahooProto::im_sendackfail_longmsg(HANDLE hContact)
int __cdecl CYahooProto::SendMsg( HANDLE hContact, int flags, const char* pszSrc )
{
- DBVARIANT dbv;
- char *msg;
- int bANSI;
-
- bANSI = 0;/*GetByte("DisableUTF8", 0);*/
-
if (!m_bLoggedIn) {/* don't send message if we not connected! */
YForkThread( &CYahooProto::im_sendackfail, hContact );
return 1;
}
- if (bANSI)
- /* convert to ANSI */
- msg = ( char* )pszSrc;
- else if ( flags & PREF_UNICODE )
- /* convert to utf8 */
+ mir_ptr<char> msg;
+ if (flags & PREF_UNICODE) /* convert to utf8 */
msg = mir_utf8encodeW(( wchar_t* )&pszSrc[ strlen(pszSrc)+1 ] );
else if ( flags & PREF_UTF )
- msg = mir_strdup(( char* )pszSrc );
+ msg = mir_strdup(pszSrc);
else
- msg = mir_utf8encode(( char* )pszSrc );
+ msg = mir_utf8encode(pszSrc);
if (lstrlenA(msg) > 800) {
YForkThread( &CYahooProto::im_sendackfail_longmsg, hContact );
return 1;
}
+ DBVARIANT dbv;
if (!GetString( hContact, YAHOO_LOGINID, &dbv)) {
- send_msg(dbv.pszVal, GetWord( hContact, "yprotoid", 0), msg, (!bANSI) ? 1 : 0);
-
- if (!bANSI)
- mir_free(msg);
+ send_msg(dbv.pszVal, GetWord( hContact, "yprotoid", 0), msg, 1);
YForkThread( &CYahooProto::im_sendacksuccess, hContact );