void SettingsInner::gotFullSelf(const MTPUserFull &self) { if (!_self) return; App::feedPhoto(self.c_userFull().vprofile_photo); App::feedUsers(MTP_vector<MTPUser>(QVector<MTPUser>(1, self.c_userFull().vuser))); PhotoData *selfPhoto = _self->photoId ? App::photo(_self->photoId) : 0; if (selfPhoto && selfPhoto->date) { _photoLink = TextLinkPtr(new PhotoLink(selfPhoto)); } else { _photoLink = TextLinkPtr(); } }
void ProfileInner::gotFullUser(const MTPUserFull &user) { _loadingId = 0; const MTPDuserFull &d(user.c_userFull()); App::feedPhoto(d.vprofile_photo); App::feedUsers(MTP_vector<MTPUser>(QVector<MTPUser>(1, d.vuser))); PhotoData *userPhoto = _peerUser->photoId ? App::photo(_peerUser->photoId) : 0; if (userPhoto && userPhoto->date) { _photoLink = TextLinkPtr(new PhotoLink(userPhoto, _peer)); } else { _photoLink = TextLinkPtr(); } App::main()->gotNotifySetting(MTP_inputNotifyPeer(_peer->input), d.vnotify_settings); App::feedUserLink(MTP_int(_peerUser->id), d.vlink.c_contacts_link().vmy_link, d.vlink.c_contacts_link().vforeign_link); }
void ApiWrap::gotUserFull(PeerData *peer, const MTPUserFull &result) { const MTPDuserFull &d(result.c_userFull()); App::feedUsers(MTP_vector<MTPUser>(1, d.vuser), false); App::feedPhoto(d.vprofile_photo); App::feedUserLink(MTP_int(App::userFromPeer(peer->id)), d.vlink.c_contacts_link().vmy_link, d.vlink.c_contacts_link().vforeign_link, false); App::main()->gotNotifySetting(MTP_inputNotifyPeer(peer->input), d.vnotify_settings); peer->asUser()->setBotInfo(d.vbot_info); _fullPeerRequests.remove(peer); App::clearPeerUpdated(peer); emit fullPeerUpdated(peer); App::emitPeerUpdated(); }
void ApiWrap::gotUserFull(PeerData *peer, const MTPUserFull &result, mtpRequestId req) { const MTPDuserFull &d(result.c_userFull()); App::feedUsers(MTP_vector<MTPUser>(1, d.vuser), false); App::feedPhoto(d.vprofile_photo); App::feedUserLink(MTP_int(peerToUser(peer->id)), d.vlink.c_contacts_link().vmy_link, d.vlink.c_contacts_link().vforeign_link, false); App::main()->gotNotifySetting(MTP_inputNotifyPeer(peer->input), d.vnotify_settings); peer->asUser()->setBotInfo(d.vbot_info); peer->asUser()->blocked = mtpIsTrue(d.vblocked) ? UserIsBlocked : UserIsNotBlocked; if (req) { QMap<PeerData*, mtpRequestId>::iterator i = _fullPeerRequests.find(peer); if (i != _fullPeerRequests.cend() && i.value() == req) { _fullPeerRequests.erase(i); } } App::clearPeerUpdated(peer); emit fullPeerUpdated(peer); App::emitPeerUpdated(); }