mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 14:38:15 +00:00
Added view-profile-in-chats-list-context-menu option.
This commit is contained in:
@@ -10,6 +10,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include "api/api_chat_participants.h"
|
||||
#include "lang/lang_keys.h"
|
||||
#include "ui/boxes/confirm_box.h"
|
||||
#include "base/options.h"
|
||||
#include "boxes/delete_messages_box.h"
|
||||
#include "boxes/max_invite_box.h"
|
||||
#include "boxes/mute_settings_box.h"
|
||||
@@ -69,11 +70,21 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include <QAction>
|
||||
|
||||
namespace Window {
|
||||
|
||||
const char kOptionViewProfileInChatsListContextMenu[] =
|
||||
"view-profile-in-chats-list-context-menu";
|
||||
|
||||
namespace {
|
||||
|
||||
constexpr auto kArchivedToastDuration = crl::time(5000);
|
||||
constexpr auto kMaxUnreadWithoutConfirmation = 10000;
|
||||
|
||||
base::options::toggle ViewProfileInChatsListContextMenu({
|
||||
.id = kOptionViewProfileInChatsListContextMenu,
|
||||
.name = "Add \"View Profile\"",
|
||||
.description = "Add \"View Profile\" to context menu in chats list",
|
||||
});
|
||||
|
||||
void SetActionText(not_null<QAction*> action, rpl::producer<QString> &&text) {
|
||||
const auto lifetime = Ui::CreateChild<rpl::lifetime>(action.get());
|
||||
std::move(
|
||||
@@ -736,6 +747,9 @@ void Filler::fillChatsListActions() {
|
||||
addHidePromotion();
|
||||
addToggleArchive();
|
||||
addTogglePin();
|
||||
if (ViewProfileInChatsListContextMenu.value()) {
|
||||
addInfo();
|
||||
}
|
||||
addToggleMute();
|
||||
addToggleUnreadMark();
|
||||
// addToFolder();
|
||||
|
Reference in New Issue
Block a user