mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-09-02 15:45:12 +00:00
Added waiting for full data update of peer to open EditPeerInfoBox.
This commit is contained in:
@@ -7,6 +7,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||||||
*/
|
*/
|
||||||
#include "window/window_controller.h"
|
#include "window/window_controller.h"
|
||||||
|
|
||||||
|
#include "boxes/peers/edit_peer_info_box.h"
|
||||||
#include "window/main_window.h"
|
#include "window/main_window.h"
|
||||||
#include "info/info_memento.h"
|
#include "info/info_memento.h"
|
||||||
#include "info/info_controller.h"
|
#include "info/info_controller.h"
|
||||||
@@ -100,6 +101,18 @@ Controller::Controller(
|
|||||||
: Navigation(session)
|
: Navigation(session)
|
||||||
, _window(window) {
|
, _window(window) {
|
||||||
init();
|
init();
|
||||||
|
|
||||||
|
subscribe(Auth().api().fullPeerUpdated(), [=](PeerData *peer) {
|
||||||
|
if (peer == _showEditPeer) {
|
||||||
|
_showEditPeer = nullptr;
|
||||||
|
Ui::show(Box<EditPeerInfoBox>(peer));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
void Controller::showEditPeerBox(PeerData *peer) {
|
||||||
|
_showEditPeer = peer;
|
||||||
|
Auth().api().requestFullPeer(peer);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Controller::init() {
|
void Controller::init() {
|
||||||
|
@@ -9,6 +9,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||||||
|
|
||||||
#include <rpl/variable.h>
|
#include <rpl/variable.h>
|
||||||
#include "base/flags.h"
|
#include "base/flags.h"
|
||||||
|
#include "base/observer.h"
|
||||||
#include "dialogs/dialogs_key.h"
|
#include "dialogs/dialogs_key.h"
|
||||||
|
|
||||||
class AuthSession;
|
class AuthSession;
|
||||||
@@ -137,7 +138,9 @@ private:
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class Controller : public Navigation {
|
class Controller
|
||||||
|
: public Navigation
|
||||||
|
, private base::Subscriber {
|
||||||
public:
|
public:
|
||||||
Controller(
|
Controller(
|
||||||
not_null<AuthSession*> session,
|
not_null<AuthSession*> session,
|
||||||
@@ -160,6 +163,7 @@ public:
|
|||||||
rpl::producer<Dialogs::RowDescriptor> activeChatEntryValue() const;
|
rpl::producer<Dialogs::RowDescriptor> activeChatEntryValue() const;
|
||||||
rpl::producer<Dialogs::Key> activeChatValue() const;
|
rpl::producer<Dialogs::Key> activeChatValue() const;
|
||||||
bool jumpToChatListEntry(Dialogs::RowDescriptor row);
|
bool jumpToChatListEntry(Dialogs::RowDescriptor row);
|
||||||
|
void showEditPeerBox(PeerData *peer);
|
||||||
|
|
||||||
void enableGifPauseReason(GifPauseReason reason);
|
void enableGifPauseReason(GifPauseReason reason);
|
||||||
void disableGifPauseReason(GifPauseReason reason);
|
void disableGifPauseReason(GifPauseReason reason);
|
||||||
@@ -308,6 +312,8 @@ private:
|
|||||||
Media::Player::FloatDelegate *_defaultFloatPlayerDelegate = nullptr;
|
Media::Player::FloatDelegate *_defaultFloatPlayerDelegate = nullptr;
|
||||||
Media::Player::FloatDelegate *_replacementFloatPlayerDelegate = nullptr;
|
Media::Player::FloatDelegate *_replacementFloatPlayerDelegate = nullptr;
|
||||||
|
|
||||||
|
PeerData *_showEditPeer = nullptr;
|
||||||
|
|
||||||
rpl::lifetime _lifetime;
|
rpl::lifetime _lifetime;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user