From 101ec9a1c12abce7502caf07456e55f46b79e0f5 Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 14 Jul 2017 12:51:02 +0300 Subject: [PATCH] Remove duplicated Copy Link context menu items. When right clicking on a real link don't add a message link copy. Fixes #3662 --- Telegram/SourceFiles/history/history_inner_widget.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Telegram/SourceFiles/history/history_inner_widget.cpp b/Telegram/SourceFiles/history/history_inner_widget.cpp index a3f823e56a..403aa0d3b7 100644 --- a/Telegram/SourceFiles/history/history_inner_widget.cpp +++ b/Telegram/SourceFiles/history/history_inner_widget.cpp @@ -1328,8 +1328,10 @@ void HistoryInner::showContextMenu(QContextMenuEvent *e, bool showFromTouch) { if (!linkCopyToClipboardText.isEmpty()) { _menu->addAction(linkCopyToClipboardText, this, SLOT(copyContextUrl()))->setEnabled(true); } - if (item && item->hasDirectLink() && isUponSelected != 2 && isUponSelected != -2) { - _menu->addAction(lang(item->history()->peer->isMegagroup() ? lng_context_copy_link : lng_context_copy_post_link), _widget, SLOT(onCopyPostLink())); + if (linkCopyToClipboardText.isEmpty()) { + if (item && item->hasDirectLink() && isUponSelected != 2 && isUponSelected != -2) { + _menu->addAction(lang(item->history()->peer->isMegagroup() ? lng_context_copy_link : lng_context_copy_post_link), _widget, SLOT(onCopyPostLink())); + } } if (isUponSelected > 1) { if (selectedState.count > 0 && selectedState.count == selectedState.canForwardCount) {