diff options
author | George Hazan <ghazan@miranda.im> | 2022-07-16 21:23:06 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2022-07-16 21:23:06 +0300 |
commit | cd4272ca22d47cdf673bfb0e5ec353acca3d9569 (patch) | |
tree | 0e2a4879766d8197cdf8a8fb6d5f5033399a0ea4 /plugins/BuddyExpectator/src | |
parent | d6a052756f58211067a7a67d7e3c1dbe7e6c9465 (diff) |
Contact_IsGroupChat - a helper to detect chat rooms
Diffstat (limited to 'plugins/BuddyExpectator/src')
-rw-r--r-- | plugins/BuddyExpectator/src/BuddyExpectator.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/plugins/BuddyExpectator/src/BuddyExpectator.cpp b/plugins/BuddyExpectator/src/BuddyExpectator.cpp index 907f33be39..f33df6a7f3 100644 --- a/plugins/BuddyExpectator/src/BuddyExpectator.cpp +++ b/plugins/BuddyExpectator/src/BuddyExpectator.cpp @@ -435,7 +435,7 @@ int onPrebuildContactMenu(WPARAM hContact, LPARAM) else
Menu_ModifyItem(hContactMenu, LPGENW("Enable Miss You"), iconList[2].hIcolib);
- Menu_ShowItem(hContactMenu, !db_get_b(hContact, proto, "ChatRoom", 0) && (CallProtoService(proto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_IMSEND));
+ Menu_ShowItem(hContactMenu, !Contact_IsGroupChat(hContact, proto) && (CallProtoService(proto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_IMSEND));
return 0;
}
@@ -460,8 +460,7 @@ int SettingChanged(WPARAM hContact, LPARAM lParam) return 0;
char *proto = Proto_GetBaseAccountName(hContact);
- if (proto == nullptr || (db_get_b(hContact, proto, "ChatRoom", 0) == 1)
- || !(CallProtoService(proto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_IMSEND))
+ if (proto == nullptr || Contact_IsGroupChat(hContact, proto) || !(CallProtoService(proto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_IMSEND))
return 0;
int currentStatus = inf->value.wVal;
@@ -539,7 +538,10 @@ void CALLBACK TimerProc(HWND, UINT, UINT_PTR, DWORD) {
for (auto &hContact : Contacts()) {
char *proto = Proto_GetBaseAccountName(hContact);
- if (proto && (db_get_b(hContact, proto, "ChatRoom", 0) == 0) && (CallProtoService(proto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_IMSEND) && isContactGoneFor(hContact, options.iAbsencePeriod2) && (g_plugin.getByte(hContact, "StillAbsentNotified", 0) == 0))
+ if (proto && !Contact_IsGroupChat(hContact, proto)
+ && (CallProtoService(proto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_IMSEND)
+ && isContactGoneFor(hContact, options.iAbsencePeriod2)
+ && (g_plugin.getByte(hContact, "StillAbsentNotified", 0) == 0))
{
g_plugin.setByte(hContact, "StillAbsentNotified", 1);
Skin_PlaySound("buddyExpectatorStillAbsent");
|