diff options
author | George Hazan <george.hazan@gmail.com> | 2014-03-11 19:31:07 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2014-03-11 19:31:07 +0000 |
commit | bd4c78f20e084ccdd20c05d1420c06969bc44925 (patch) | |
tree | f55baccb22766d17223a06fe9207c2bc547a8e20 /src/modules/metacontacts | |
parent | fc4ce5a1e786192c86f14e9d99ad9b14eab201ef (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')
-rw-r--r-- | src/modules/metacontacts/meta_main.cpp | 4 | ||||
-rw-r--r-- | src/modules/metacontacts/meta_utils.cpp | 36 | ||||
-rw-r--r-- | src/modules/metacontacts/metacontacts.h | 7 |
3 files changed, 16 insertions, 31 deletions
diff --git a/src/modules/metacontacts/meta_main.cpp b/src/modules/metacontacts/meta_main.cpp index 446bc515f8..e550c329c7 100644 --- a/src/modules/metacontacts/meta_main.cpp +++ b/src/modules/metacontacts/meta_main.cpp @@ -73,10 +73,6 @@ int LoadMetacontacts(void) Meta_ReadOptions(&options);
PROTOCOLDESCRIPTOR pd = { PROTOCOLDESCRIPTOR_V3_SIZE };
- pd.szName = META_FILTER;
- pd.type = PROTOTYPE_FILTER;
- CallService(MS_PROTO_REGISTERMODULE, 0, (LPARAM)&pd);
-
pd.szName = META_PROTO;
pd.type = PROTOTYPE_VIRTUAL;
CallService(MS_PROTO_REGISTERMODULE, 0, (LPARAM)&pd);
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;
}
diff --git a/src/modules/metacontacts/metacontacts.h b/src/modules/metacontacts/metacontacts.h index df70f7ed4b..170d83da49 100644 --- a/src/modules/metacontacts/metacontacts.h +++ b/src/modules/metacontacts/metacontacts.h @@ -20,12 +20,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-#define META_FILTER "MetaContactsFilter"
-#define META_FILTER_ID "MetaFilterID"
-
-#define MAX_CONTACTS 20
-
-// I can't think of a way around this - mental block
+#define MAX_CONTACTS 20
INT_PTR TranslateMenuFunc(MCONTACT hContact, int i);
|