Allow stories administrator rights in supergroups.

This commit is contained in:
levlam 2024-02-11 02:16:25 +03:00
parent 81f959be99
commit 539fd729ea
3 changed files with 5 additions and 8 deletions

View File

@ -660,9 +660,9 @@ chatPermissions can_send_basic_messages:Bool can_send_audios:Bool can_send_docum
//@can_manage_topics True, if the administrator can create, rename, close, reopen, hide, and unhide forum topics; applicable to forum supergroups only
//@can_promote_members True, if the administrator can add new administrators with a subset of their own privileges or demote administrators that were directly or indirectly promoted by them
//@can_manage_video_chats True, if the administrator can manage video chats
//@can_post_stories True, if the administrator can create new channel stories, or edit and delete posted stories; applicable to channels only
//@can_edit_stories True, if the administrator can edit stories posted by other users, pin stories and access story archive; applicable to channels only
//@can_delete_stories True, if the administrator can delete stories posted by other users; applicable to channels only
//@can_post_stories True, if the administrator can create new chat stories, or edit and delete posted stories
//@can_edit_stories True, if the administrator can edit stories posted by other users, pin stories and access story archive
//@can_delete_stories True, if the administrator can delete stories posted by other users
//@is_anonymous True, if the administrator isn't shown in the chat member list and sends messages anonymously; applicable to supergroups only
chatAdministratorRights can_manage_chat:Bool can_change_info:Bool can_post_messages:Bool can_edit_messages:Bool can_delete_messages:Bool can_invite_users:Bool can_restrict_members:Bool can_pin_messages:Bool can_manage_topics:Bool can_promote_members:Bool can_manage_video_chats:Bool can_post_stories:Bool can_edit_stories:Bool can_delete_stories:Bool is_anonymous:Bool = ChatAdministratorRights;

View File

@ -64,9 +64,6 @@ AdministratorRights::AdministratorRights(bool is_anonymous, bool can_manage_dial
case ChannelType::Megagroup:
can_post_messages = false;
can_edit_messages = false;
can_post_stories = false;
can_edit_stories = false;
can_delete_stories = false;
break;
case ChannelType::Unknown:
break;

View File

@ -1039,7 +1039,7 @@ TEST(Link, parse_internal_link_part3) {
"stories+delete_stories+anonymous",
bot_start_in_group("username", "",
chat_administrator_rights(true, true, false, false, true, true, true, true, true, true, true,
false, false, false, true)));
true, true, true, true)));
parse_internal_link("tg:resolve?domain=username&startchannel", public_chat("username"));
parse_internal_link("tg:resolve?domain=username&startchannel&admin=", public_chat("username"));
@ -1077,7 +1077,7 @@ TEST(Link, parse_internal_link_part3) {
"stories+anonymous",
bot_start_in_group("username", "",
chat_administrator_rights(true, true, false, false, true, true, true, true, true, true, true,
false, false, false, true)));
true, true, true, true)));
parse_internal_link("t.me/username?startchannel", public_chat("username"));
parse_internal_link("t.me/username?startchannel&admin=", public_chat("username"));