aboutsummaryrefslogtreecommitdiffhomepage
path: root/td/telegram/DialogParticipant.cpp
diff options
context:
space:
mode:
authorlevlam <levlam@telegram.org>2026-07-10 00:11:39 +0300
committerlevlam <levlam@telegram.org>2026-07-10 00:11:39 +0300
commit575e5f8fb06010227c3ffe3bf1c69dfda1c739da (patch)
tree2018916b575b2aa064114fed8a871ce2a7226a23 /td/telegram/DialogParticipant.cpp
parenta83a851fe42c393cd34ffd8fcb9ef9ebe3e7db0c (diff)
Add community.permissions.
Diffstat (limited to 'td/telegram/DialogParticipant.cpp')
-rw-r--r--td/telegram/DialogParticipant.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/td/telegram/DialogParticipant.cpp b/td/telegram/DialogParticipant.cpp
index 5a83c8841..2a257a901 100644
--- a/td/telegram/DialogParticipant.cpp
+++ b/td/telegram/DialogParticipant.cpp
@@ -215,6 +215,14 @@ RestrictedRights::RestrictedRights(const td_api::object_ptr<td_api::chatPermissi
rights->can_edit_tag_, rights->can_react_to_messages_, false, channel_type);
}
+RestrictedRights::RestrictedRights(const td_api::object_ptr<td_api::communityPermissions> &rights) {
+ if (rights == nullptr) {
+ flags_ = 0;
+ return;
+ }
+ flags_ = (static_cast<uint64>(rights->can_edit_chat_list_) * CAN_MANAGE_LINKED_PEERS);
+}
+
RestrictedRights::RestrictedRights(bool can_send_messages, bool can_send_audios, bool can_send_documents,
bool can_send_photos, bool can_send_videos, bool can_send_video_notes,
bool can_send_voice_notes, bool can_send_stickers, bool can_send_animations,
@@ -262,6 +270,10 @@ td_api::object_ptr<td_api::chatPermissions> RestrictedRights::get_chat_permissio
can_invite_users(), can_pin_messages(), can_manage_topics());
}
+td_api::object_ptr<td_api::communityPermissions> RestrictedRights::get_community_permissions_object() const {
+ return td_api::make_object<td_api::communityPermissions>(can_manage_linked_peers());
+}
+
telegram_api::object_ptr<telegram_api::chatBannedRights> RestrictedRights::get_chat_banned_rights() const {
return telegram_api::make_object<telegram_api::chatBannedRights>(
0, false /*view_messages*/, false /*send_messages*/, false /*send_media*/, !can_send_stickers(),