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/Clist_modern/src | |
parent | d6a052756f58211067a7a67d7e3c1dbe7e6c9465 (diff) |
Contact_IsGroupChat - a helper to detect chat rooms
Diffstat (limited to 'plugins/Clist_modern/src')
-rw-r--r-- | plugins/Clist_modern/src/modern_awaymsg.cpp | 3 | ||||
-rw-r--r-- | plugins/Clist_modern/src/modern_clc.cpp | 4 | ||||
-rw-r--r-- | plugins/Clist_modern/src/modern_clc.h | 2 |
3 files changed, 4 insertions, 5 deletions
diff --git a/plugins/Clist_modern/src/modern_awaymsg.cpp b/plugins/Clist_modern/src/modern_awaymsg.cpp index 5674f61c45..b4f0f5f6a4 100644 --- a/plugins/Clist_modern/src/modern_awaymsg.cpp +++ b/plugins/Clist_modern/src/modern_awaymsg.cpp @@ -144,8 +144,7 @@ void amRequestAwayMsg(MCONTACT hContact) return;
//Do not re-ask for chat rooms
- char *szProto = Proto_GetBaseAccountName(hContact);
- if (szProto != nullptr && !db_get_b(hContact, szProto, "ChatRoom", 0))
+ if (!Contact_IsGroupChat(hContact))
amAddHandleToChain(hContact);
}
diff --git a/plugins/Clist_modern/src/modern_clc.cpp b/plugins/Clist_modern/src/modern_clc.cpp index d356273e57..417ab0a97e 100644 --- a/plugins/Clist_modern/src/modern_clc.cpp +++ b/plugins/Clist_modern/src/modern_clc.cpp @@ -1658,7 +1658,7 @@ int ClcDoProtoAck(ACKDATA *ack) if (ack->type == ACKTYPE_AWAYMSG) {
if (ack->result == ACKRESULT_SUCCESS && ack->lParam) {
if (ack->szModule != nullptr)
- if (db_get_b(ack->hContact, ack->szModule, "ChatRoom", 0) != 0)
+ if (Contact_IsGroupChat(ack->hContact, ack->szModule))
return 0;
g_plugin.setWString(ack->hContact, "StatusMsg", (const wchar_t *)ack->lParam);
@@ -1666,7 +1666,7 @@ int ClcDoProtoAck(ACKDATA *ack) }
else {
if (ack->szModule != nullptr)
- if (db_get_b(ack->hContact, ack->szModule, "ChatRoom", 0) != 0)
+ if (Contact_IsGroupChat(ack->hContact, ack->szModule))
return 0;
if (ack->hContact) {
diff --git a/plugins/Clist_modern/src/modern_clc.h b/plugins/Clist_modern/src/modern_clc.h index bfbb0e50d4..fb06744325 100644 --- a/plugins/Clist_modern/src/modern_clc.h +++ b/plugins/Clist_modern/src/modern_clc.h @@ -200,7 +200,7 @@ struct ClcContact : public ClcContactBase { return (style & CLS_CHECKBOXES && type == CLCIT_CONTACT) || (style & CLS_GROUPCHECKBOXES && type == CLCIT_GROUP) || (type == CLCIT_INFO && flags & CLCIIF_CHECKBOX);
}
__forceinline bool isChat() const
- { return (type == CLCIT_CONTACT) && (db_get_b(hContact, pce->szProto, "ChatRoom", 0) != 0);
+ { return (type == CLCIT_CONTACT) && Contact_IsGroupChat(hContact, pce->szProto);
}
};
|