diff options
author | George Hazan <george.hazan@gmail.com> | 2014-02-27 21:51:46 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2014-02-27 21:51:46 +0000 |
commit | 1fb0cd07fba1e8d6f9ac2ebe3b4f2e1c60acb81b (patch) | |
tree | 904c95b33e03e806aea734552281257768273a14 /plugins/AVS | |
parent | a8e8aebfd4f53977873c72c2d828c2c1f505f10d (diff) |
- metacontacts are always present;
- added META_PROTO constant for mc module name;
- MS_MC_GETPROTOCOLNAME removed, because it always returns META_PROTO
git-svn-id: http://svn.miranda-ng.org/main/trunk@8319 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/AVS')
-rw-r--r-- | plugins/AVS/src/cache.cpp | 10 | ||||
-rw-r--r-- | plugins/AVS/src/commonheaders.h | 3 | ||||
-rw-r--r-- | plugins/AVS/src/main.cpp | 13 | ||||
-rw-r--r-- | plugins/AVS/src/poll.cpp | 5 | ||||
-rw-r--r-- | plugins/AVS/src/utils.cpp | 4 |
5 files changed, 11 insertions, 24 deletions
diff --git a/plugins/AVS/src/cache.cpp b/plugins/AVS/src/cache.cpp index 37c42cb00d..93aa9abe1d 100644 --- a/plugins/AVS/src/cache.cpp +++ b/plugins/AVS/src/cache.cpp @@ -126,8 +126,7 @@ CacheNode *FindAvatarInCache(MCONTACT hContact, BOOL add, BOOL findAny) }
foundNode->ace.hContact = hContact;
- if (g_MetaAvail)
- foundNode->dwFlags |= (db_mc_isSub(hContact) ? MC_ISSUBCONTACT : 0);
+ foundNode->dwFlags |= (db_mc_isSub(hContact) ? MC_ISSUBCONTACT : 0);
foundNode->loaded = FALSE;
foundNode->mustLoad = 1; // pic loader will watch this and load images
SetEvent(hLoaderEvent); // wake him up
@@ -153,8 +152,8 @@ void NotifyMetaAware(MCONTACT hContact, CacheNode *node = NULL, AVATARCACHEENTRY NotifyEventHooks(hEventChanged, hContact, (LPARAM)ace);
- if (g_MetaAvail && (node->dwFlags & MC_ISSUBCONTACT) && db_get_b(NULL, g_szMetaName, "Enabled", 0)) {
- MCONTACT hMasterContact = (MCONTACT)db_get_dw(hContact, g_szMetaName, "Handle", 0);
+ if ((node->dwFlags & MC_ISSUBCONTACT) && db_get_b(NULL, META_PROTO, "Enabled", 0)) {
+ MCONTACT hMasterContact = (MCONTACT)db_get_dw(hContact, META_PROTO, "Handle", 0);
if (hMasterContact && (MCONTACT)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)hMasterContact, 0) == hContact &&
!db_get_b(hMasterContact, "ContactPhoto", "Locked", 0))
NotifyEventHooks(hEventChanged, (WPARAM)hMasterContact, (LPARAM)ace);
@@ -209,8 +208,7 @@ void DeleteAvatarFromCache(MCONTACT hContact, BOOL forever) CacheNode *node = FindAvatarInCache(hContact, FALSE);
if (node == NULL) {
struct CacheNode temp_node = {0};
- if (g_MetaAvail)
- temp_node.dwFlags |= (db_mc_isSub(hContact) ? MC_ISSUBCONTACT : 0);
+ temp_node.dwFlags |= (db_mc_isSub(hContact) ? MC_ISSUBCONTACT : 0);
NotifyMetaAware(hContact, &temp_node, (AVATARCACHEENTRY *)GetProtoDefaultAvatar(hContact));
return;
}
diff --git a/plugins/AVS/src/commonheaders.h b/plugins/AVS/src/commonheaders.h index 6507b2ecd9..87f8044d8d 100644 --- a/plugins/AVS/src/commonheaders.h +++ b/plugins/AVS/src/commonheaders.h @@ -109,9 +109,8 @@ extern FI_INTERFACE *fei; void mir_sleep(int time);
extern bool g_shutDown;
-extern char *g_szMetaName;
extern TCHAR g_szDataPath[]; // user datae path (read at startup only)
-extern BOOL g_MetaAvail, g_AvatarHistoryAvail;
+extern BOOL g_AvatarHistoryAvail;
extern HWND hwndSetMyAvatar;
extern HINSTANCE g_hInst;
diff --git a/plugins/AVS/src/main.cpp b/plugins/AVS/src/main.cpp index 7270485770..caa11b7469 100644 --- a/plugins/AVS/src/main.cpp +++ b/plugins/AVS/src/main.cpp @@ -31,7 +31,6 @@ bool g_shutDown = false; int hLangpack;
TCHAR g_szDataPath[MAX_PATH]; // user datae path (read at startup only)
-BOOL g_MetaAvail = FALSE;
BOOL g_AvatarHistoryAvail = FALSE;
HWND hwndSetMyAvatar = 0;
@@ -100,8 +99,7 @@ static TCHAR* getJGMailID(char *szProto) static int ProtocolAck(WPARAM wParam, LPARAM lParam)
{
ACKDATA *ack = (ACKDATA *) lParam;
-
- if (ack != NULL && ack->type == ACKTYPE_AVATAR && ack->hContact != 0 && (!g_MetaAvail || strcmp(ack->szModule, g_szMetaName))) {
+ if (ack != NULL && ack->type == ACKTYPE_AVATAR && ack->hContact != 0 && strcmp(ack->szModule, META_PROTO)) {
if (ack->result == ACKRESULT_SUCCESS) {
if (ack->hProcess == NULL)
ProcessAvatarInfo(ack->hContact, GAIR_NOAVATAR, NULL, ack->szModule);
@@ -232,7 +230,7 @@ static int ContactSettingChanged(WPARAM hContact, LPARAM lParam) return 0;
}
- if (g_MetaAvail && !strcmp(cws->szModule, g_szMetaName)) {
+ if (!strcmp(cws->szModule, META_PROTO)) {
if (lstrlenA(cws->szSetting) > 6 && !strncmp(cws->szSetting, "Status", 5))
MetaChanged(hContact, 0);
}
@@ -376,13 +374,6 @@ static int ModulesLoaded(WPARAM wParam, LPARAM lParam) g_AvatarHistoryAvail = ServiceExists(MS_AVATARHISTORY_ENABLED);
- g_MetaAvail = ServiceExists(MS_MC_GETPROTOCOLNAME) ? TRUE : FALSE;
- if (g_MetaAvail) {
- g_szMetaName = (char *)CallService(MS_MC_GETPROTOCOLNAME, 0, 0);
- if (g_szMetaName == NULL)
- g_MetaAvail = FALSE;
- }
-
PROTOACCOUNT **accs = NULL;
int accCount;
ProtoEnumAccounts(&accCount, &accs);
diff --git a/plugins/AVS/src/poll.cpp b/plugins/AVS/src/poll.cpp index d017ef3aa3..bb52ee316f 100644 --- a/plugins/AVS/src/poll.cpp +++ b/plugins/AVS/src/poll.cpp @@ -88,9 +88,8 @@ static BOOL PollProtocolCanHaveAvatar(const char *szProto) {
int pCaps = CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_4, 0);
int status = CallProtoService(szProto, PS_GETSTATUS, 0, 0);
- return (pCaps & PF4_AVATARS)
- && (g_szMetaName == NULL || strcmp(g_szMetaName, szProto))
- && ((status > ID_STATUS_OFFLINE && status != ID_STATUS_INVISIBLE) || Proto_IsFetchingWhenProtoNotVisibleAllowed(szProto));
+ return (pCaps & PF4_AVATARS) && strcmp(META_PROTO, szProto) &&
+ ((status > ID_STATUS_OFFLINE && status != ID_STATUS_INVISIBLE) || Proto_IsFetchingWhenProtoNotVisibleAllowed(szProto));
}
// Return true if this protocol has to be checked
diff --git a/plugins/AVS/src/utils.cpp b/plugins/AVS/src/utils.cpp index 721d93282e..2565b6cad7 100644 --- a/plugins/AVS/src/utils.cpp +++ b/plugins/AVS/src/utils.cpp @@ -508,8 +508,8 @@ protoPicCacheEntry *GetProtoDefaultAvatar(MCONTACT hContact) MCONTACT GetContactThatHaveTheAvatar(MCONTACT hContact, int locked)
{
- if (g_MetaAvail && db_get_b(NULL, g_szMetaName, "Enabled", 0)) {
- if (db_get_dw(hContact, g_szMetaName, "NumContacts", 0) >= 1) {
+ if (db_get_b(NULL, META_PROTO, "Enabled", 0)) {
+ if (db_get_dw(hContact, META_PROTO, "NumContacts", 0) >= 1) {
if (locked == -1)
locked = db_get_b(hContact, "ContactPhoto", "Locked", 0);
|