mirror of
https://github.com/vale981/tdesktop
synced 2025-03-06 02:01:40 -05:00
Update user status in Info::Profile cover.
This commit is contained in:
parent
0ced28f991
commit
da386f2c2e
2 changed files with 11 additions and 3 deletions
|
@ -243,7 +243,8 @@ Cover::Cover(
|
|||
this,
|
||||
_peer->isMegagroup()
|
||||
? st::infoProfileMegagroupStatusLabel
|
||||
: st::infoProfileStatusLabel) {
|
||||
: st::infoProfileStatusLabel)
|
||||
, _refreshStatusTimer([this] { refreshStatusText(); }) {
|
||||
_peer->updateFull();
|
||||
|
||||
_name->setSelectable(true);
|
||||
|
@ -351,8 +352,13 @@ void Cover::refreshStatusText() {
|
|||
auto statusText = [&] {
|
||||
auto currentTime = unixtime();
|
||||
if (auto user = _peer->asUser()) {
|
||||
auto result = App::onlineText(user, currentTime, true);
|
||||
return App::onlineColorUse(user, currentTime)
|
||||
const auto result = App::onlineText(user, currentTime, true);
|
||||
const auto showOnline = App::onlineColorUse(user, currentTime);
|
||||
const auto updateIn = App::onlineWillChangeIn(user, currentTime);
|
||||
if (showOnline) {
|
||||
_refreshStatusTimer.callOnce(updateIn * 1000LL);
|
||||
}
|
||||
return showOnline
|
||||
? textcmdLink(1, result)
|
||||
: result;
|
||||
} else if (auto chat = _peer->asChat()) {
|
||||
|
|
|
@ -22,6 +22,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
|
|||
|
||||
#include "ui/wrap/padding_wrap.h"
|
||||
#include "ui/widgets/checkbox.h"
|
||||
#include "base/timer.h"
|
||||
|
||||
namespace style {
|
||||
struct InfoToggle;
|
||||
|
@ -95,6 +96,7 @@ private:
|
|||
object_ptr<Ui::RpWidget> _verifiedCheck = { nullptr };
|
||||
object_ptr<Ui::FlatLabel> _status = { nullptr };
|
||||
//object_ptr<CoverDropArea> _dropArea = { nullptr };
|
||||
base::Timer _refreshStatusTimer;
|
||||
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue