From 36efd5151e53f6ebae280ca9992a1fa824086aef Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 21 Nov 2023 17:44:50 +0300 Subject: added ability to mark contacts as read-only --- src/mir_app/src/contacts.cpp | 15 +++++++++++++++ src/mir_app/src/mir_app.def | 2 ++ src/mir_app/src/mir_app64.def | 2 ++ 3 files changed, 19 insertions(+) (limited to 'src') diff --git a/src/mir_app/src/contacts.cpp b/src/mir_app/src/contacts.cpp index 94d6313df8..a486cc988c 100644 --- a/src/mir_app/src/contacts.cpp +++ b/src/mir_app/src/contacts.cpp @@ -306,6 +306,21 @@ MIR_APP_DLL(void) Contact::Hide(MCONTACT hContact, bool bHidden) /////////////////////////////////////////////////////////////////////////////// +MIR_APP_DLL(bool) Contact::IsReadonly(MCONTACT hContact) +{ + return db_get_b(hContact, "CList", "ReadOnly") != 0; +} + +MIR_APP_DLL(void) Contact::Readonly(MCONTACT hContact, bool bReadOnly) +{ + if (bReadOnly) + db_set_b(hContact, "CList", "ReadOnly", 1); + else + db_unset(hContact, "CList", "ReadOnly"); +} + +/////////////////////////////////////////////////////////////////////////////// + MIR_APP_DLL(bool) Contact::OnList(MCONTACT hContact) { return db_get_b(hContact, "CList", "NotOnList", 0) == 0; diff --git a/src/mir_app/src/mir_app.def b/src/mir_app/src/mir_app.def index c670d01805..bd9234ca7e 100644 --- a/src/mir_app/src/mir_app.def +++ b/src/mir_app/src/mir_app.def @@ -909,3 +909,5 @@ Clist_GroupSaveExpanded @1003 NONAME ?Srmm_GetWindowClass@@YGPAUSrmmLogWindowClass@@PAVCMsgDialog@@@Z @1027 NONAME ?addColor@CMPluginBase@@QAEHPBD0PB_W1K@Z @1028 NONAME ?addFont@CMPluginBase@@QAEHPBD0PB_W111HHPAUtagLOGFONTW@@K@Z @1029 NONAME +?IsReadonly@Contact@@YG_NI@Z @1030 NONAME +?Readonly@Contact@@YGXI_N@Z @1031 NONAME diff --git a/src/mir_app/src/mir_app64.def b/src/mir_app/src/mir_app64.def index fd393985c3..478cde2493 100644 --- a/src/mir_app/src/mir_app64.def +++ b/src/mir_app/src/mir_app64.def @@ -909,3 +909,5 @@ Clist_GroupSaveExpanded @1003 NONAME ?Srmm_GetWindowClass@@YAPEAUSrmmLogWindowClass@@PEAVCMsgDialog@@@Z @1027 NONAME ?addColor@CMPluginBase@@QEAAHPEBD0PEB_W1K@Z @1028 NONAME ?addFont@CMPluginBase@@QEAAHPEBD0PEB_W111HHPEAUtagLOGFONTW@@K@Z @1029 NONAME +?IsReadonly@Contact@@YA_NI@Z @1030 NONAME +?Readonly@Contact@@YAXI_N@Z @1031 NONAME -- cgit v1.2.3