diff --git a/Telegram/SourceFiles/boxes/peers/add_bot_to_chat_box.cpp b/Telegram/SourceFiles/boxes/peers/add_bot_to_chat_box.cpp index 0dc3bd9d06..d8c6001d4c 100644 --- a/Telegram/SourceFiles/boxes/peers/add_bot_to_chat_box.cpp +++ b/Telegram/SourceFiles/boxes/peers/add_bot_to_chat_box.cpp @@ -217,7 +217,7 @@ void AddBotToGroupBoxController::addBotToGroup(not_null chat) { controller->hideLayer(); controller->showPeerHistory(chat, Way::ClearStack, ShowAtUnreadMsgId); }; - const auto rights = requestedAddAdmin + const auto rights = (requestedAddAdmin && _requestedRights != 0) ? _requestedRights : (chat->isBroadcast() && chat->asBroadcast()->canAddAdmins()) diff --git a/Telegram/SourceFiles/core/local_url_handlers.cpp b/Telegram/SourceFiles/core/local_url_handlers.cpp index 3abb775ec4..4222b11967 100644 --- a/Telegram/SourceFiles/core/local_url_handlers.cpp +++ b/Telegram/SourceFiles/core/local_url_handlers.cpp @@ -460,7 +460,9 @@ bool ShowWallPaper( const QString &value) { auto result = ChatAdminRights(); for (const auto &element : value.split(QRegularExpression(u"[+ ]"_q))) { - if (element == u"change_info"_q) { + if (element.isEmpty()) { + continue; + } else if (element == u"change_info"_q) { result |= ChatAdminRight::ChangeInfo; } else if (element == u"post_messages"_q) { result |= ChatAdminRight::PostMessages; @@ -478,6 +480,12 @@ bool ShowWallPaper( result |= ChatAdminRight::PinMessages; } else if (element == u"promote_members"_q) { result |= ChatAdminRight::AddAdmins; + } else if (element == u"post_stories"_q) { + result |= ChatAdminRight::PostStories; + } else if (element == u"edit_stories"_q) { + result |= ChatAdminRight::EditStories; + } else if (element == u"delete_stories"_q) { + result |= ChatAdminRight::DeleteStories; } else if (element == u"manage_video_chats"_q) { result |= ChatAdminRight::ManageCall; } else if (element == u"manage_direct_messages"_q) { @@ -487,7 +495,7 @@ bool ShowWallPaper( } else if (element == u"manage_chat"_q) { result |= ChatAdminRight::Other; } else { - return {}; + continue; } } return result;