From de1841e8600420cf3cf35cb73d6e0226a9519687 Mon Sep 17 00:00:00 2001 From: Piotr Piastucki Date: Thu, 4 Jun 2015 12:10:46 +0000 Subject: Fixed a memleak in groupchat Added support for contact list fetching for plain Skype user finally enabling usage of Skype accounts via skylogin.dll (login only working once in a session though, currently cannot find out why). Prevent launching of duplicate keepAliveThread git-svn-id: http://svn.miranda-ng.org/main/trunk@13995 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/MSN/src/msn_proto.cpp | 54 +++++++++++++++++++++++++++-------------- 1 file changed, 36 insertions(+), 18 deletions(-) (limited to 'protocols/MSN/src/msn_proto.cpp') diff --git a/protocols/MSN/src/msn_proto.cpp b/protocols/MSN/src/msn_proto.cpp index dce9ae50ff..9e8603def2 100644 --- a/protocols/MSN/src/msn_proto.cpp +++ b/protocols/MSN/src/msn_proto.cpp @@ -406,11 +406,13 @@ void __cdecl CMsnProto::MsnSearchAckThread(void* arg) return; } - unsigned res = MSN_ABContactAdd(email, NULL, NETID_MSN, NULL, 1, true); - switch (res) { - case 0: - case 2: - case 3: + if (MyOptions.netId == NETID_SKYPE) MSN_SKYABSearch(email, arg); + else { + unsigned res = MSN_ABContactAdd(email, NULL, NETID_MSN, NULL, 1, true); + switch (res) { + case 0: + case 2: + case 3: { PROTOSEARCHRESULT psr = { 0 }; psr.cbSize = sizeof(psr); @@ -418,25 +420,27 @@ void __cdecl CMsnProto::MsnSearchAckThread(void* arg) psr.id.t = (TCHAR*)emailT; psr.nick.t = (TCHAR*)emailT; psr.email.t = (TCHAR*)emailT; + ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_DATA, arg, (LPARAM)&psr); + ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_SUCCESS, arg, 0); } - ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_SUCCESS, arg, 0); break; - case 1: - if (strstr(email, "@yahoo.com") == NULL) + case 1: + if (strstr(email, "@yahoo.com") == NULL) + ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_SUCCESS, arg, 0); + #ifdef OBSOLETE + else { + msnSearchId = arg; + MSN_FindYahooUser(email); + } + #endif + break; + + default: ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_SUCCESS, arg, 0); -#ifdef OBSOLETE - else { - msnSearchId = arg; - MSN_FindYahooUser(email); + break; } -#endif - break; - - default: - ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_SUCCESS, arg, 0); - break; } mir_free(arg); } @@ -814,6 +818,20 @@ int __cdecl CMsnProto::RecvMsg(MCONTACT hContact, PROTORECVEVENT* pre) return Proto_RecvMessage(hContact, pre); } +int CMsnProto::GetInfo(MCONTACT hContact, int infoType) +{ + if (MyOptions.netId == NETID_SKYPE) { + char tEmail[MSN_MAX_EMAIL_LEN]; + if (db_get_static(hContact, m_szModuleName, "wlid", tEmail, sizeof(tEmail))) + db_get_static(hContact, m_szModuleName, "e-mail", tEmail, sizeof(tEmail)); + + MSN_SKYABGetProfile(tEmail); + return 1; + } + return 0; +} + + ///////////////////////////////////////////////////////////////////////////////////////// // MsnRecvContacts - creates a database event from the contacts received -- cgit v1.2.3