mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Removed Ui::showPeerProfile from controller of ShowInviteLinkBox.
This commit is contained in:
parent
026045af17
commit
28331b3617
1 changed files with 14 additions and 3 deletions
|
@ -7,6 +7,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
*/
|
*/
|
||||||
#include "boxes/peers/edit_peer_invite_link.h"
|
#include "boxes/peers/edit_peer_invite_link.h"
|
||||||
|
|
||||||
|
#include "core/application.h"
|
||||||
#include "data/data_peer.h"
|
#include "data/data_peer.h"
|
||||||
#include "data/data_user.h"
|
#include "data/data_user.h"
|
||||||
#include "data/data_channel.h"
|
#include "data/data_channel.h"
|
||||||
|
@ -35,9 +36,9 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "ui/boxes/confirm_box.h"
|
#include "ui/boxes/confirm_box.h"
|
||||||
#include "boxes/peer_list_box.h"
|
#include "boxes/peer_list_box.h"
|
||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
#include "facades.h" // Ui::showPerProfile.
|
|
||||||
#include "lang/lang_keys.h"
|
#include "lang/lang_keys.h"
|
||||||
#include "window/window_session_controller.h"
|
#include "window/window_session_controller.h"
|
||||||
|
#include "window/window_controller.h"
|
||||||
#include "settings/settings_common.h"
|
#include "settings/settings_common.h"
|
||||||
#include "mtproto/sender.h"
|
#include "mtproto/sender.h"
|
||||||
#include "qr/qr_generate.h"
|
#include "qr/qr_generate.h"
|
||||||
|
@ -60,6 +61,16 @@ constexpr auto kShareQrPadding = 16;
|
||||||
|
|
||||||
using LinkData = Api::InviteLink;
|
using LinkData = Api::InviteLink;
|
||||||
|
|
||||||
|
void ShowPeerInfoSync(not_null<PeerData*> peer) {
|
||||||
|
// While a peer info is demanded by the left click
|
||||||
|
// we can safely use activeWindow.
|
||||||
|
if (const auto window = Core::App().activeWindow()) {
|
||||||
|
if (const auto controller = window->sessionController()) {
|
||||||
|
controller->showPeerInfo(peer);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
class RequestedRow final : public PeerListRow {
|
class RequestedRow final : public PeerListRow {
|
||||||
public:
|
public:
|
||||||
RequestedRow(not_null<PeerData*> peer, TimeId date);
|
RequestedRow(not_null<PeerData*> peer, TimeId date);
|
||||||
|
@ -721,7 +732,7 @@ void Controller::appendSlice(const Api::JoinedByLinkSlice &slice) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Controller::rowClicked(not_null<PeerListRow*> row) {
|
void Controller::rowClicked(not_null<PeerListRow*> row) {
|
||||||
Ui::showPeerProfile(row->peer());
|
ShowPeerInfoSync(row->peer());
|
||||||
}
|
}
|
||||||
|
|
||||||
void Controller::rowRightActionClicked(not_null<PeerListRow*> row) {
|
void Controller::rowRightActionClicked(not_null<PeerListRow*> row) {
|
||||||
|
@ -852,7 +863,7 @@ void SingleRowController::loadMoreRows() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void SingleRowController::rowClicked(not_null<PeerListRow*> row) {
|
void SingleRowController::rowClicked(not_null<PeerListRow*> row) {
|
||||||
Ui::showPeerProfile(row->peer());
|
ShowPeerInfoSync(row->peer());
|
||||||
}
|
}
|
||||||
|
|
||||||
Main::Session &SingleRowController::session() const {
|
Main::Session &SingleRowController::session() const {
|
||||||
|
|
Loading…
Add table
Reference in a new issue