From 1ce3da1cca093143d9629bc46e221dd8be962e12 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 31 May 2015 11:46:05 +0000 Subject: - MAllStrings: a handy union to hold an incoming string parameter of any type; - FNAMECHAR: atavism extincted; - PROTOSEARCHRESULT: structure prepared to use results of any type, including utf git-svn-id: http://svn.miranda-ng.org/main/trunk@13932 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Yahoo/src/proto.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'protocols/Yahoo/src/proto.cpp') diff --git a/protocols/Yahoo/src/proto.cpp b/protocols/Yahoo/src/proto.cpp index c757fa6fe7..f144d89c9b 100644 --- a/protocols/Yahoo/src/proto.cpp +++ b/protocols/Yahoo/src/proto.cpp @@ -99,7 +99,7 @@ int CYahooProto::OnModulesLoadedEx(WPARAM, LPARAM) //////////////////////////////////////////////////////////////////////////////////////// // AddToList - adds a contact to the contact list -MCONTACT CYahooProto::AddToList( int flags, PROTOSEARCHRESULT* psr ) +MCONTACT CYahooProto::AddToList(int flags, PROTOSEARCHRESULT *psr) { debugLogA("[YahooAddToList] Flags: %d", flags); @@ -108,12 +108,13 @@ MCONTACT CYahooProto::AddToList( int flags, PROTOSEARCHRESULT* psr ) return 0; } - if (psr == NULL || psr->cbSize != sizeof( PROTOSEARCHRESULT )) { + YAHOO_SEARCH_RESULT *ysr = (YAHOO_SEARCH_RESULT*)psr; + if (ysr == NULL || ysr->cbSize != sizeof(YAHOO_SEARCH_RESULT)) { debugLogA("[YahooAddToList] Empty data passed?"); return 0; } - char *id = psr->flags & PSR_UNICODE ? mir_utf8encodeW((wchar_t*)psr->id) : mir_utf8encode((char*)psr->id); + char *id = psr->flags & PSR_UNICODE ? mir_utf8encodeW((wchar_t*)psr->id.t) : mir_utf8encode((char*)psr->id.t); MCONTACT hContact = getbuddyH(id); if (hContact != NULL) { if (db_get_b(hContact, "CList", "NotOnList", 0)) { @@ -130,7 +131,7 @@ MCONTACT CYahooProto::AddToList( int flags, PROTOSEARCHRESULT* psr ) debugLogA("[YahooAddToList] Adding Temporary Buddy:%s ", id); } - int protocol = psr->reserved[0]; + int protocol = ysr->protocol; debugLogA("Adding buddy:%s", id); hContact = add_buddy(id, id, protocol, flags); mir_free(id); -- cgit v1.2.3