summaryrefslogtreecommitdiff
path: root/src/modules/metacontacts/meta_utils.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2014-03-11 19:31:07 +0000
committerGeorge Hazan <george.hazan@gmail.com>2014-03-11 19:31:07 +0000
commitbd4c78f20e084ccdd20c05d1420c06969bc44925 (patch)
treef55baccb22766d17223a06fe9207c2bc547a8e20 /src/modules/metacontacts/meta_utils.cpp
parentfc4ce5a1e786192c86f14e9d99ad9b14eab201ef (diff)
metacontact filter removed (yeehaw!)
git-svn-id: http://svn.miranda-ng.org/main/trunk@8561 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/modules/metacontacts/meta_utils.cpp')
-rw-r--r--src/modules/metacontacts/meta_utils.cpp36
1 files changed, 15 insertions, 21 deletions
diff --git a/src/modules/metacontacts/meta_utils.cpp b/src/modules/metacontacts/meta_utils.cpp
index 8c32e25105..370295e59d 100644
--- a/src/modules/metacontacts/meta_utils.cpp
+++ b/src/modules/metacontacts/meta_utils.cpp
@@ -465,35 +465,29 @@ int Meta_SuppressStatus(BOOL suppress)
int Meta_CopyContactNick(DBCachedContact *ccMeta, MCONTACT hContact)
{
- DBVARIANT dbv, dbv_proto;
-
if (options.bLockHandle)
hContact = Meta_GetContactHandle(ccMeta, 0);
if (!hContact)
return 1;
- // szProto = GetContactProto(hContact);
- // read szProto direct from db, since we do this on load and other szProto plugins may not be loaded yet
- if (!db_get(hContact, "Protocol", "p", &dbv_proto)) {
- char *szProto = dbv_proto.pszVal;
- if (options.clist_contact_name == CNNT_NICK && szProto) {
- if (!db_get_s(hContact, szProto, "Nick", &dbv, 0)) {
- db_set(ccMeta->contactID, META_PROTO, "Nick", &dbv);
- db_free(&dbv);
- db_free(&dbv_proto);
- return 0;
- }
+ char *szProto = GetContactProto(hContact);
+ if (szProto == NULL)
+ return 1;
+
+ if (options.clist_contact_name == CNNT_NICK) {
+ ptrT tszNick(db_get_tsa(hContact, szProto, "Nick"));
+ if (tszNick) {
+ db_set_ts(ccMeta->contactID, META_PROTO, "Nick", tszNick);
+ return 0;
}
- else if (options.clist_contact_name == CNNT_DISPLAYNAME) {
- TCHAR *name = cli.pfnGetContactDisplayName(hContact, 0);
- if (name && _tcscmp(name, TranslateT("(Unknown Contact)")) != 0) {
- db_set_ts(ccMeta->contactID, META_PROTO, "Nick", name);
- db_free(&dbv_proto);
- return 0;
- }
+ }
+ else if (options.clist_contact_name == CNNT_DISPLAYNAME) {
+ TCHAR *name = cli.pfnGetContactDisplayName(hContact, 0);
+ if (name && _tcscmp(name, TranslateT("(Unknown Contact)")) != 0) {
+ db_set_ts(ccMeta->contactID, META_PROTO, "Nick", name);
+ return 0;
}
- db_free(&dbv_proto);
}
return 1;
}