mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-17 06:37:24 +02:00
Removed Ui::showPeerProfile.
This commit is contained in:
parent
58163ea581
commit
cc7a4c2772
4 changed files with 13 additions and 32 deletions
|
@ -30,6 +30,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
|
||||
namespace {
|
||||
|
||||
// Possible context owners: media viewer, profile, history widget.
|
||||
|
||||
void SearchByHashtag(ClickContext context, const QString &tag) {
|
||||
const auto my = context.other.value<ClickHandlerContext>();
|
||||
const auto controller = my.sessionWindow.get();
|
||||
|
@ -172,9 +174,10 @@ QString MentionClickHandler::copyToClipboardContextItemText() const {
|
|||
void MentionClickHandler::onClick(ClickContext context) const {
|
||||
const auto button = context.button;
|
||||
if (button == Qt::LeftButton || button == Qt::MiddleButton) {
|
||||
if (const auto m = App::main()) { // multi good
|
||||
const auto my = context.other.value<ClickHandlerContext>();
|
||||
if (const auto controller = my.sessionWindow.get()) {
|
||||
using Info = Window::SessionNavigation::PeerByLinkInfo;
|
||||
m->controller()->showPeerByLink(Info{
|
||||
controller->showPeerByLink(Info{
|
||||
.usernameOrId = _tag.mid(1),
|
||||
.resolveType = Window::ResolveType::Mention,
|
||||
});
|
||||
|
@ -189,8 +192,11 @@ auto MentionClickHandler::getTextEntity() const -> TextEntity {
|
|||
void MentionNameClickHandler::onClick(ClickContext context) const {
|
||||
const auto button = context.button;
|
||||
if (button == Qt::LeftButton || button == Qt::MiddleButton) {
|
||||
if (auto user = _session->data().userLoaded(_userId)) {
|
||||
Ui::showPeerProfile(user);
|
||||
const auto my = context.other.value<ClickHandlerContext>();
|
||||
if (const auto controller = my.sessionWindow.get()) {
|
||||
if (auto user = _session->data().userLoaded(_userId)) {
|
||||
controller->showPeerInfo(user);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -251,29 +251,6 @@ void activateBotCommand(
|
|||
|
||||
namespace Ui {
|
||||
|
||||
void showPeerProfile(not_null<PeerData*> peer) {
|
||||
if (const auto window = App::wnd()) { // multi good
|
||||
if (const auto controller = window->sessionController()) {
|
||||
if (&controller->session() == &peer->session()) {
|
||||
controller->showPeerInfo(peer);
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (&Core::App().domain().active() != &peer->session().account()) {
|
||||
Core::App().domain().activate(&peer->session().account());
|
||||
}
|
||||
if (const auto controller = window->sessionController()) {
|
||||
if (&controller->session() == &peer->session()) {
|
||||
controller->showPeerInfo(peer);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void showPeerProfile(not_null<const History*> history) {
|
||||
showPeerProfile(history->peer);
|
||||
}
|
||||
|
||||
void showChatsList(not_null<Main::Session*> session) {
|
||||
if (const auto m = CheckMainWidget(session)) {
|
||||
m->ui_showPeerHistory(
|
||||
|
|
|
@ -47,9 +47,6 @@ namespace Ui {
|
|||
|
||||
// Legacy global methods.
|
||||
|
||||
void showPeerProfile(not_null<PeerData*> peer);
|
||||
void showPeerProfile(not_null<const History*> history);
|
||||
|
||||
void showPeerHistory(not_null<const PeerData*> peer, MsgId msgId);
|
||||
void showPeerHistory(not_null<const History*> history, MsgId msgId);
|
||||
void showChatsList(not_null<Main::Session*> session);
|
||||
|
|
|
@ -79,7 +79,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "storage/file_download.h"
|
||||
#include "storage/storage_account.h"
|
||||
#include "calls/calls_instance.h"
|
||||
#include "facades.h"
|
||||
#include "styles/style_media_view.h"
|
||||
#include "styles/style_chat.h"
|
||||
#include "styles/style_menu_icons.h"
|
||||
|
@ -4482,7 +4481,9 @@ void OverlayWidget::handleMouseRelease(
|
|||
if (_over == OverName && _down == OverName) {
|
||||
if (_from) {
|
||||
close();
|
||||
Ui::showPeerProfile(_from);
|
||||
if (const auto window = findWindow(true)) {
|
||||
window->showPeerInfo(_from);
|
||||
}
|
||||
}
|
||||
} else if (_over == OverDate && _down == OverDate) {
|
||||
toMessage();
|
||||
|
|
Loading…
Add table
Reference in a new issue