From 097c52ad9a2928422084bf76cebee58958341574 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 7 Apr 2013 19:47:13 +0000 Subject: end of the old database macroses git-svn-id: http://svn.miranda-ng.org/main/trunk@4373 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Yahoo/src/proto.cpp | 38 +++++++++++++++----------------------- 1 file changed, 15 insertions(+), 23 deletions(-) (limited to 'protocols/Yahoo') diff --git a/protocols/Yahoo/src/proto.cpp b/protocols/Yahoo/src/proto.cpp index fcd5827ffd..41f84eb7e7 100644 --- a/protocols/Yahoo/src/proto.cpp +++ b/protocols/Yahoo/src/proto.cpp @@ -210,16 +210,12 @@ int CYahooProto::Authorize( HANDLE hdbe ) /* Need to remove the buddy from our Miranda Lists */ HANDLE hContact = DbGetAuthEventContact(&dbei); if (hContact != NULL) { - char *who = DBGetString(hContact, m_szModuleName, YAHOO_LOGINID); - if (!who) return 0; - - char *myid = DBGetString(hContact, m_szModuleName, "MyIdentity"); - - DebugLog("Accepting buddy:%s", who); - accept(myid, who, GetWord(hContact, "yprotoid", 0)); - - mir_free(myid); - mir_free(who); + mir_ptr who( db_get_sa(hContact, m_szModuleName, YAHOO_LOGINID)); + if (who) { + mir_ptr myid( db_get_sa(hContact, m_szModuleName, "MyIdentity")); + DebugLog("Accepting buddy:%s", who); + accept(myid, who, GetWord(hContact, "yprotoid", 0)); + } } return 0; @@ -259,19 +255,15 @@ int CYahooProto::AuthDeny( HANDLE hdbe, const TCHAR* reason ) /* Need to remove the buddy from our Miranda Lists */ HANDLE hContact = DbGetAuthEventContact(&dbei); if (hContact != NULL) { - char *who = DBGetString(hContact, m_szModuleName, YAHOO_LOGINID); - if (!who) return 0; - - char *myid = DBGetString(hContact, m_szModuleName, "MyIdentity"); - char *u_reason = mir_utf8encodeT(reason); - - DebugLog("Rejecting buddy:%s msg: %s", who, u_reason); - reject(myid, who, GetWord(hContact, "yprotoid", 0), u_reason); - CallService(MS_DB_CONTACT_DELETE, (WPARAM) hContact, 0); - - mir_free(u_reason); - mir_free(myid); - mir_free(who); + mir_ptr who( db_get_sa(hContact, m_szModuleName, YAHOO_LOGINID)); + if (who) { + mir_ptr myid( db_get_sa(hContact, m_szModuleName, "MyIdentity")); + mir_ptr u_reason( mir_utf8encodeT(reason)); + + DebugLog("Rejecting buddy:%s msg: %s", who, u_reason); + reject(myid, who, GetWord(hContact, "yprotoid", 0), u_reason); + CallService(MS_DB_CONTACT_DELETE, (WPARAM) hContact, 0); + } } return 0; } -- cgit v1.2.3