summaryrefslogtreecommitdiff
path: root/protocols/Yahoo
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-04-07 19:47:13 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-04-07 19:47:13 +0000
commit097c52ad9a2928422084bf76cebee58958341574 (patch)
tree26d6b11e9738fc4e854f68c0ff04eaadf7d849e8 /protocols/Yahoo
parentf096b29abb03618ec609ba4acaedaed43eec1fea (diff)
end of the old database macroses
git-svn-id: http://svn.miranda-ng.org/main/trunk@4373 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Yahoo')
-rw-r--r--protocols/Yahoo/src/proto.cpp38
1 files changed, 15 insertions, 23 deletions
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<char> who( db_get_sa(hContact, m_szModuleName, YAHOO_LOGINID));
+ if (who) {
+ mir_ptr<char> 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<char> who( db_get_sa(hContact, m_szModuleName, YAHOO_LOGINID));
+ if (who) {
+ mir_ptr<char> myid( db_get_sa(hContact, m_szModuleName, "MyIdentity"));
+ mir_ptr<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);
+ }
}
return 0;
}