diff options
-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);
}
|