summaryrefslogtreecommitdiff
path: root/protocols/Yahoo/src/yahoo.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-05-22 16:04:17 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-05-22 16:04:17 +0000
commite2c2a1f5a84c6c9b705dc85c6a2dd1f97edd57e4 (patch)
treeba79bdcede96f80039f8b88d2791f198b9ec2981 /protocols/Yahoo/src/yahoo.cpp
parentf8e34b5f83f3ce5f39d541e9068b6b8cb6d92acd (diff)
T2Utf - handy replacement for ptrA<mir_utf8decodeT()>
git-svn-id: http://svn.miranda-ng.org/main/trunk@13758 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Yahoo/src/yahoo.cpp')
-rw-r--r--protocols/Yahoo/src/yahoo.cpp46
1 files changed, 9 insertions, 37 deletions
diff --git a/protocols/Yahoo/src/yahoo.cpp b/protocols/Yahoo/src/yahoo.cpp
index 3f70ae957a..58c9089d4d 100644
--- a/protocols/Yahoo/src/yahoo.cpp
+++ b/protocols/Yahoo/src/yahoo.cpp
@@ -200,56 +200,28 @@ void CYahooProto::logout()
void CYahooProto::AddBuddy(MCONTACT hContact, const char *group, const TCHAR *msg)
{
- DBVARIANT dbv;
- char *fname=NULL, *lname=NULL, *ident=NULL, *who, *u_msg;
- int protocol;
-
/* We adding a buddy to our list.
2 Stages.
1. We send add buddy packet.
2. We get a packet back from the server confirming add.
No refresh needed. */
-
- if (!getString(hContact, YAHOO_LOGINID, &dbv))
- {
- who = strdup(dbv.pszVal);
- db_free(&dbv);
- }
- else
- return;
-
- protocol = getWord(hContact, "yprotoid", 0);
- u_msg = mir_utf8encodeT(msg);
- if (!getString(hContact, "MyIdentity", &dbv))
- {
- ident = strdup(dbv.pszVal);
- db_free(&dbv);
- }
+ ptrA who(getStringA(hContact, YAHOO_LOGINID));
+ if (who == NULL)
+ return;
- if (!GetStringUtf(NULL, "FirstName", &dbv))
- {
- fname = strdup(dbv.pszVal);
- db_free(&dbv);
- }
+ int protocol = getWord(hContact, "yprotoid", 0);
+ T2Utf u_msg(msg);
- if (!GetStringUtf(NULL, "LastName", &dbv))
- {
- lname = strdup(dbv.pszVal);
- db_free(&dbv);
- }
+ ptrA ident(getStringA(hContact, "MyIdentity"));
+ ptrT fname(getTStringA(NULL, "FirstName"));
+ ptrT lname(getTStringA(NULL, "LastName"));
SetStringUtf(hContact, "YGroup", group);
debugLogA("Adding Permanently %s to list. Auth: %s", who, u_msg ? u_msg : "<None>");
- yahoo_add_buddy(m_id, ident, fname, lname, who, protocol, group, u_msg);
-
- free(fname);
- free(lname);
- free(ident);
- free(who);
- mir_free(u_msg);
+ yahoo_add_buddy(m_id, ident, T2Utf(fname), T2Utf(lname), who, protocol, group, u_msg);
}
MCONTACT CYahooProto::getbuddyH(const char *yahoo_id)