2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Update full peer in profile and settings.

Not more than once in five seconds get the full info to update bio.
This commit is contained in:
John Preston
2017-07-26 14:53:49 +03:00
parent 24b3b2a658
commit 2e5930eb58
6 changed files with 34 additions and 17 deletions

View File

@@ -299,6 +299,7 @@ void ApiWrap::gotChatFull(PeerData *peer, const MTPmessages_ChatFull &result, mt
chat->photoId = 0;
}
chat->setInviteLink((f.vexported_invite.type() == mtpc_chatInviteExported) ? qs(f.vexported_invite.c_chatInviteExported().vlink) : QString());
chat->fullUpdated();
notifySettingReceived(MTP_inputNotifyPeer(peer->input), f.vnotify_settings);
} else if (auto channel = peer->asChannel()) {
@@ -426,6 +427,7 @@ void ApiWrap::gotUserFull(UserData *user, const MTPUserFull &result, mtpRequestI
user->setCallsStatus(d.is_phone_calls_private() ? UserData::CallsStatus::Private : d.is_phone_calls_available() ? UserData::CallsStatus::Enabled : UserData::CallsStatus::Disabled);
user->setAbout(d.has_about() ? qs(d.vabout) : QString());
user->setCommonChatsCount(d.vcommon_chats_count.v);
user->fullUpdated();
if (req) {
auto i = _fullPeerRequests.find(user);
@@ -763,7 +765,7 @@ void ApiWrap::unblockParticipant(PeerData *peer, UserData *user) {
if (channel->kickedCount() > 0) {
channel->setKickedCount(channel->kickedCount() - 1);
} else {
channel->updateFull(true);
channel->updateFullForced();
}
}
}).fail([this, kick](const RPCError &error) {
@@ -1443,7 +1445,7 @@ void ApiWrap::resolveWebPages() {
void ApiWrap::requestParticipantsCountDelayed(ChannelData *channel) {
_participantsCountRequestTimer.call(kReloadChannelMembersTimeout, [this, channel] {
channel->updateFull(true);
channel->updateFullForced();
});
}