2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-30 22:16:14 +00:00

added some checks

This commit is contained in:
John Preston
2015-10-03 14:33:51 +03:00
parent e3e774176e
commit 605b18aa27
12 changed files with 39 additions and 29 deletions

View File

@@ -93,7 +93,7 @@ ProfileInner::ProfileInner(ProfileWidget *profile, ScrollArea *scroll, const Pee
_photoLink = TextLinkPtr(new PhotoLink(userPhoto, _peer));
}
if ((_peerUser->botInfo && !_peerUser->botInfo->inited) || (_peerUser->photoId == UnknownPeerPhotoId) || (_peerUser->photoId && !userPhoto->date) || (_peerUser->blocked == UserBlockUnknown)) {
App::api()->requestFullPeer(_peer);
if (App::api()) App::api()->requestFullPeer(_peer);
}
} else if (_peerChat) {
PhotoData *chatPhoto = (_peerChat->photoId && _peerChat->photoId != UnknownPeerPhotoId) ? App::photo(_peerChat->photoId) : 0;
@@ -101,7 +101,7 @@ ProfileInner::ProfileInner(ProfileWidget *profile, ScrollArea *scroll, const Pee
_photoLink = TextLinkPtr(new PhotoLink(chatPhoto, _peer));
}
if (_peerChat->photoId == UnknownPeerPhotoId) {
App::api()->requestFullPeer(_peer);
if (App::api()) App::api()->requestFullPeer(_peer);
}
} else if (_peerChannel) {
PhotoData *chatPhoto = (_peerChannel->photoId && _peerChannel->photoId != UnknownPeerPhotoId) ? App::photo(_peerChannel->photoId) : 0;
@@ -607,7 +607,7 @@ void ProfileInner::reorderParticipants() {
}
}
if (_peerChat->count > 0 && _participants.isEmpty()) {
App::api()->requestFullPeer(_peer);
if (App::api()) App::api()->requestFullPeer(_peer);
if (_onlineText.isEmpty()) _onlineText = lng_chat_status_members(lt_count, _peerChat->count);
} else if (onlineCount && !onlyMe) {
_onlineText = lng_chat_status_members_online(lt_count, _participants.size(), lt_count_online, onlineCount);