diff options
author | George Hazan <george.hazan@gmail.com> | 2023-11-21 19:02:12 +0300 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2023-11-21 19:02:12 +0300 |
commit | a4c4e3fc08395be5fc83b6f36fc1be07dbe5b245 (patch) | |
tree | 460b1564a6981e862093eed9d6cfa7c7234085d1 | |
parent | ee23690fa6c847a5284f8145e73328cdaab2b617 (diff) |
fixes #3945 (Плагины сообщений: скрывать элементы окна в зависимости от типа привата)
-rw-r--r-- | protocols/NewsAggregator/Src/Options.cpp | 2 | ||||
-rw-r--r-- | protocols/NewsAggregator/Src/Services.cpp | 1 | ||||
-rw-r--r-- | protocols/Telegram/src/server.cpp | 9 |
3 files changed, 10 insertions, 2 deletions
diff --git a/protocols/NewsAggregator/Src/Options.cpp b/protocols/NewsAggregator/Src/Options.cpp index b35585cfaa..c4c98d16ca 100644 --- a/protocols/NewsAggregator/Src/Options.cpp +++ b/protocols/NewsAggregator/Src/Options.cpp @@ -562,6 +562,7 @@ bool CImportFeed::OnApply() MCONTACT hContact = db_add_contact(); Proto_AddToContact(hContact, MODULENAME); + Contact::Readonly(hContact); g_plugin.setWString(hContact, "Nick", text); g_plugin.setWString(hContact, "URL", url); if (siteurl) @@ -771,6 +772,7 @@ bool CFeedEditor::OnApply() hContact = db_add_contact(); Proto_AddToContact(hContact, MODULENAME); g_plugin.setByte(hContact, "CheckState", 1); + Contact::Readonly(hContact); } else hContact = m_hContact; diff --git a/protocols/NewsAggregator/Src/Services.cpp b/protocols/NewsAggregator/Src/Services.cpp index a05231779a..ed4f9e49cd 100644 --- a/protocols/NewsAggregator/Src/Services.cpp +++ b/protocols/NewsAggregator/Src/Services.cpp @@ -37,6 +37,7 @@ int NewsAggrInit(WPARAM, LPARAM) mir_wstrncpy(tszRoot, VARSW(L"%miranda_userdata%\\Avatars\\" _A2W(DEFAULT_AVATARS_FOLDER)), _countof(tszRoot)); for (auto &hContact : Contacts(MODULENAME)) { + Contact::Readonly(hContact); if (!g_plugin.getByte("StartupRetrieve", 1)) g_plugin.setDword(hContact, "LastCheck", (uint32_t)time(0)); g_plugin.setWord(hContact, "Status", ID_STATUS_ONLINE); diff --git a/protocols/Telegram/src/server.cpp b/protocols/Telegram/src/server.cpp index 80c25d9b95..9baa1fe26c 100644 --- a/protocols/Telegram/src/server.cpp +++ b/protocols/Telegram/src/server.cpp @@ -487,8 +487,13 @@ void CTelegramProto::ProcessChat(TD::updateNewChat *pObj) if (CheckSearchUser(pUser))
return;
- if (pUser->isGroupChat && pUser->hContact != INVALID_CONTACT_ID)
- InitGroupChat(pUser, pChat);
+ if (pUser->hContact != INVALID_CONTACT_ID) {
+ if (pChat->permissions_)
+ Contact::Readonly(hContact, !pChat->permissions_->can_send_basic_messages_);
+
+ if (pUser->isGroupChat)
+ InitGroupChat(pUser, pChat);
+ }
}
else debugLogA("Unknown user id %lld, ignoring", userId);
}
|