summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2023-11-21 17:44:50 +0300
committerGeorge Hazan <george.hazan@gmail.com>2023-11-21 17:44:50 +0300
commit36efd5151e53f6ebae280ca9992a1fa824086aef (patch)
tree14dd51fb67c9c7d929824ad5ae55af7178a5b00d /src
parent4f38af21d106fe759a31c2fe360ce9170119ad66 (diff)
added ability to mark contacts as read-only
Diffstat (limited to 'src')
-rw-r--r--src/mir_app/src/contacts.cpp15
-rw-r--r--src/mir_app/src/mir_app.def2
-rw-r--r--src/mir_app/src/mir_app64.def2
3 files changed, 19 insertions, 0 deletions
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