mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Show special phone number context number.
This commit is contained in:
parent
7bf1f9bd71
commit
f77fdc799d
3 changed files with 13 additions and 1 deletions
|
@ -16,6 +16,7 @@ constexpr auto kDocumentLinkMediaProperty = 0x03;
|
||||||
constexpr auto kSendReactionEmojiProperty = 0x04;
|
constexpr auto kSendReactionEmojiProperty = 0x04;
|
||||||
constexpr auto kReactionsCountEmojiProperty = 0x05;
|
constexpr auto kReactionsCountEmojiProperty = 0x05;
|
||||||
constexpr auto kDocumentFilenameTooltipProperty = 0x06;
|
constexpr auto kDocumentFilenameTooltipProperty = 0x06;
|
||||||
|
constexpr auto kPhoneNumberLinkProperty = 0x07;
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
class Show;
|
class Show;
|
||||||
|
|
|
@ -291,6 +291,7 @@ PhoneClickHandler::PhoneClickHandler(
|
||||||
QString text)
|
QString text)
|
||||||
: _session(session)
|
: _session(session)
|
||||||
, _text(text) {
|
, _text(text) {
|
||||||
|
setProperty(kPhoneNumberLinkProperty, _text);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PhoneClickHandler::onClick(ClickContext context) const {
|
void PhoneClickHandler::onClick(ClickContext context) const {
|
||||||
|
|
|
@ -10,6 +10,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "chat_helpers/stickers_emoji_pack.h"
|
#include "chat_helpers/stickers_emoji_pack.h"
|
||||||
#include "core/file_utilities.h"
|
#include "core/file_utilities.h"
|
||||||
#include "core/click_handler_types.h"
|
#include "core/click_handler_types.h"
|
||||||
|
#include "core/phone_click_handler.h"
|
||||||
#include "history/history_item_helpers.h"
|
#include "history/history_item_helpers.h"
|
||||||
#include "history/view/controls/history_view_forward_panel.h"
|
#include "history/view/controls/history_view_forward_panel.h"
|
||||||
#include "history/view/controls/history_view_draft_options.h"
|
#include "history/view/controls/history_view_draft_options.h"
|
||||||
|
@ -2200,6 +2201,10 @@ void HistoryInner::showContextMenu(QContextMenuEvent *e, bool showFromTouch) {
|
||||||
&& Api::WhoReactedExists(leaderOrSelf, Api::WhoReactedList::All);
|
&& Api::WhoReactedExists(leaderOrSelf, Api::WhoReactedList::All);
|
||||||
using namespace HistoryView::Reactions;
|
using namespace HistoryView::Reactions;
|
||||||
const auto clickedReaction = ReactionIdOfLink(link);
|
const auto clickedReaction = ReactionIdOfLink(link);
|
||||||
|
const auto linkPhoneNumber = link
|
||||||
|
? link->property(kPhoneNumberLinkProperty).toString()
|
||||||
|
: QString();
|
||||||
|
const auto session = &this->session();
|
||||||
_whoReactedMenuLifetime.destroy();
|
_whoReactedMenuLifetime.destroy();
|
||||||
if (!clickedReaction.empty()
|
if (!clickedReaction.empty()
|
||||||
&& leaderOrSelf
|
&& leaderOrSelf
|
||||||
|
@ -2214,9 +2219,14 @@ void HistoryInner::showContextMenu(QContextMenuEvent *e, bool showFromTouch) {
|
||||||
_whoReactedMenuLifetime);
|
_whoReactedMenuLifetime);
|
||||||
e->accept();
|
e->accept();
|
||||||
return;
|
return;
|
||||||
|
} else if (!linkPhoneNumber.isEmpty()) {
|
||||||
|
PhoneClickHandler(session, linkPhoneNumber).onClick(
|
||||||
|
prepareClickContext(
|
||||||
|
Qt::LeftButton,
|
||||||
|
_dragStateItem ? _dragStateItem->fullId() : FullMsgId()));
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
_menu = base::make_unique_q<Ui::PopupMenu>(this, st::popupMenuWithIcons);
|
_menu = base::make_unique_q<Ui::PopupMenu>(this, st::popupMenuWithIcons);
|
||||||
const auto session = &this->session();
|
|
||||||
const auto controller = _controller;
|
const auto controller = _controller;
|
||||||
const auto addItemActions = [&](
|
const auto addItemActions = [&](
|
||||||
HistoryItem *item,
|
HistoryItem *item,
|
||||||
|
|
Loading…
Add table
Reference in a new issue