diff --git a/Telegram/SourceFiles/history/history_item_components.cpp b/Telegram/SourceFiles/history/history_item_components.cpp index dfcbfc6df2..b95e882a49 100644 --- a/Telegram/SourceFiles/history/history_item_components.cpp +++ b/Telegram/SourceFiles/history/history_item_components.cpp @@ -352,8 +352,9 @@ ReplyMarkupClickHandler::ReplyMarkupClickHandler( // Copy to clipboard support. QString ReplyMarkupClickHandler::copyToClipboardText() const { - if (auto button = getButton()) { - if (button->type == HistoryMessageMarkupButton::Type::Url) { + if (const auto button = getButton()) { + using Type = HistoryMessageMarkupButton::Type; + if (button->type == Type::Url || button->type == Type::Auth) { return QString::fromUtf8(button->data); } } @@ -361,8 +362,9 @@ QString ReplyMarkupClickHandler::copyToClipboardText() const { } QString ReplyMarkupClickHandler::copyToClipboardContextItemText() const { - if (auto button = getButton()) { - if (button->type == HistoryMessageMarkupButton::Type::Url) { + if (const auto button = getButton()) { + using Type = HistoryMessageMarkupButton::Type; + if (button->type == Type::Url || button->type == Type::Auth) { return lang(lng_context_copy_link); } } diff --git a/Telegram/SourceFiles/history/view/history_view_message.cpp b/Telegram/SourceFiles/history/view/history_view_message.cpp index 5f62b5c5b4..8ef3a27139 100644 --- a/Telegram/SourceFiles/history/view/history_view_message.cpp +++ b/Telegram/SourceFiles/history/view/history_view_message.cpp @@ -88,7 +88,8 @@ void KeyboardStyle::paintButtonIcon( using Type = HistoryMessageMarkupButton::Type; const auto getIcon = [](Type type) -> const style::icon* { switch (type) { - case Type::Url: return &st::msgBotKbUrlIcon; + case Type::Url: + case Type::Auth: return &st::msgBotKbUrlIcon; case Type::SwitchInlineSame: case Type::SwitchInline: return &st::msgBotKbSwitchPmIcon; } @@ -109,12 +110,12 @@ int KeyboardStyle::minButtonWidth( using Type = HistoryMessageMarkupButton::Type; int result = 2 * buttonPadding(), iconWidth = 0; switch (type) { - case Type::Url: iconWidth = st::msgBotKbUrlIcon.width(); break; + case Type::Url: + case Type::Auth: iconWidth = st::msgBotKbUrlIcon.width(); break; case Type::SwitchInlineSame: case Type::SwitchInline: iconWidth = st::msgBotKbSwitchPmIcon.width(); break; case Type::Callback: - case Type::Game: - case Type::Auth: iconWidth = st::historySendingInvertedIcon.width(); break; + case Type::Game: iconWidth = st::historySendingInvertedIcon.width(); break; } if (iconWidth > 0) { result = std::max(result, 2 * iconWidth + 4 * int(st::msgBotKbIconPadding));