Ejemplo n.º 1
0
void ProfileInner::showAll() {
	if (_peerChat) {
		_sendMessage.hide();
		_shareContact.hide();
		if (_peerChat->forbidden) {
			_uploadPhoto.hide();
			_cancelPhoto.hide();
			_addParticipant.hide();
		} else {
			if (App::app()->isPhotoUpdating(_peer->id)) {
				_uploadPhoto.hide();
				_cancelPhoto.show();
			} else {
				_uploadPhoto.show();
				_cancelPhoto.hide();
			}
			if (_peerChat->count < cMaxGroupCount()) {
				_addParticipant.show();
			} else {
				_addParticipant.hide();
			}
		}
		_enableNotifications.show();
		_clearHistory.hide();
	} else {
		_uploadPhoto.hide();
		_cancelPhoto.hide();
		_addParticipant.hide();
		_sendMessage.show();
		if (_peerUser->phone.isEmpty()) {
			_shareContact.hide();
		} else {
			_shareContact.show();
		}
		_enableNotifications.show();
		_clearHistory.show();
	}
	updateNotifySettings();

	// participants
	reorderParticipants();
	int32 h;
	if (_peerUser) {
		h = _clearHistory.y() + _clearHistory.height() + st::profileHeaderSkip;
	} else {
		h = _enableNotifications.y() + _enableNotifications.height() + st::profileHeaderSkip;
		if (!_participants.isEmpty()) {
			h += st::profileHeaderSkip + _participants.size() * _pHeight;
		} else if (_peerChat->count > 0) {
			h += st::profileHeaderSkip;
		}
	}
	resize(width(), h);
}
Ejemplo n.º 2
0
void ProfileInner::updateOnlineDisplay() {
	reorderParticipants();
	update();
}