Fix build on Windows, add report Fake-s.
This commit is contained in:
		
							parent
							
								
									416489a84f
								
							
						
					
					
						commit
						b22c65a8db
					
				
					 7 changed files with 32 additions and 29 deletions
				
			
		|  | @ -977,6 +977,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL | ||||||
| "lng_report_bot_title" = "Report bot"; | "lng_report_bot_title" = "Report bot"; | ||||||
| "lng_report_message_title" = "Report message"; | "lng_report_message_title" = "Report message"; | ||||||
| "lng_report_reason_spam" = "Spam"; | "lng_report_reason_spam" = "Spam"; | ||||||
|  | "lng_report_reason_fake" = "Fake"; | ||||||
| "lng_report_reason_violence" = "Violence"; | "lng_report_reason_violence" = "Violence"; | ||||||
| "lng_report_reason_child_abuse" = "Child Abuse"; | "lng_report_reason_child_abuse" = "Child Abuse"; | ||||||
| "lng_report_reason_pornography" = "Pornography"; | "lng_report_reason_pornography" = "Pornography"; | ||||||
|  |  | ||||||
|  | @ -73,10 +73,9 @@ void ReportBox::prepare() { | ||||||
| 			st::defaultBoxCheckbox); | 			st::defaultBoxCheckbox); | ||||||
| 	}; | 	}; | ||||||
| 	createButton(_reasonSpam, Reason::Spam, tr::lng_report_reason_spam(tr::now)); | 	createButton(_reasonSpam, Reason::Spam, tr::lng_report_reason_spam(tr::now)); | ||||||
|  | 	createButton(_reasonFake, Reason::Fake, tr::lng_report_reason_fake(tr::now)); | ||||||
| 	createButton(_reasonViolence, Reason::Violence, tr::lng_report_reason_violence(tr::now)); | 	createButton(_reasonViolence, Reason::Violence, tr::lng_report_reason_violence(tr::now)); | ||||||
| 	if (_ids) { |  | ||||||
| 	createButton(_reasonChildAbuse, Reason::ChildAbuse, tr::lng_report_reason_child_abuse(tr::now)); | 	createButton(_reasonChildAbuse, Reason::ChildAbuse, tr::lng_report_reason_child_abuse(tr::now)); | ||||||
| 	} |  | ||||||
| 	createButton(_reasonPornography, Reason::Pornography, tr::lng_report_reason_pornography(tr::now)); | 	createButton(_reasonPornography, Reason::Pornography, tr::lng_report_reason_pornography(tr::now)); | ||||||
| 	createButton(_reasonOther, Reason::Other, tr::lng_report_reason_other(tr::now)); | 	createButton(_reasonOther, Reason::Other, tr::lng_report_reason_other(tr::now)); | ||||||
| 	_reasonGroup->setChangedCallback([=](Reason value) { | 	_reasonGroup->setChangedCallback([=](Reason value) { | ||||||
|  | @ -90,14 +89,10 @@ void ReportBox::resizeEvent(QResizeEvent *e) { | ||||||
| 	BoxContent::resizeEvent(e); | 	BoxContent::resizeEvent(e); | ||||||
| 
 | 
 | ||||||
| 	_reasonSpam->moveToLeft(st::boxPadding.left() + st::boxOptionListPadding.left(), st::boxOptionListPadding.top() + _reasonSpam->getMargins().top()); | 	_reasonSpam->moveToLeft(st::boxPadding.left() + st::boxOptionListPadding.left(), st::boxOptionListPadding.top() + _reasonSpam->getMargins().top()); | ||||||
| 	_reasonViolence->moveToLeft(st::boxPadding.left() + st::boxOptionListPadding.left(), _reasonSpam->bottomNoMargins() + st::boxOptionListSkip); | 	_reasonFake->moveToLeft(st::boxPadding.left() + st::boxOptionListPadding.left(), _reasonSpam->bottomNoMargins() + st::boxOptionListSkip); | ||||||
| 	if (_ids) { | 	_reasonViolence->moveToLeft(st::boxPadding.left() + st::boxOptionListPadding.left(), _reasonFake->bottomNoMargins() + st::boxOptionListSkip); | ||||||
| 	_reasonChildAbuse->moveToLeft(st::boxPadding.left() + st::boxOptionListPadding.left(), _reasonViolence->bottomNoMargins() + st::boxOptionListSkip); | 	_reasonChildAbuse->moveToLeft(st::boxPadding.left() + st::boxOptionListPadding.left(), _reasonViolence->bottomNoMargins() + st::boxOptionListSkip); | ||||||
| 	_reasonPornography->moveToLeft(st::boxPadding.left() + st::boxOptionListPadding.left(), _reasonChildAbuse->bottomNoMargins() + st::boxOptionListSkip); | 	_reasonPornography->moveToLeft(st::boxPadding.left() + st::boxOptionListPadding.left(), _reasonChildAbuse->bottomNoMargins() + st::boxOptionListSkip); | ||||||
| 	} |  | ||||||
| 	else{ |  | ||||||
| 		_reasonPornography->moveToLeft(st::boxPadding.left() + st::boxOptionListPadding.left(), _reasonViolence->bottomNoMargins() + st::boxOptionListSkip); |  | ||||||
| 	} |  | ||||||
| 	_reasonOther->moveToLeft(st::boxPadding.left() + st::boxOptionListPadding.left(), _reasonPornography->bottomNoMargins() + st::boxOptionListSkip); | 	_reasonOther->moveToLeft(st::boxPadding.left() + st::boxOptionListPadding.left(), _reasonPornography->bottomNoMargins() + st::boxOptionListSkip); | ||||||
| 
 | 
 | ||||||
| 	if (_reasonOtherText) { | 	if (_reasonOtherText) { | ||||||
|  | @ -156,6 +151,7 @@ void ReportBox::report() { | ||||||
| 	const auto reason = [&] { | 	const auto reason = [&] { | ||||||
| 		switch (_reasonGroup->value()) { | 		switch (_reasonGroup->value()) { | ||||||
| 		case Reason::Spam: return MTP_inputReportReasonSpam(); | 		case Reason::Spam: return MTP_inputReportReasonSpam(); | ||||||
|  | 		case Reason::Fake: return MTP_inputReportReasonFake(); | ||||||
| 		case Reason::Violence: return MTP_inputReportReasonViolence(); | 		case Reason::Violence: return MTP_inputReportReasonViolence(); | ||||||
| 		case Reason::ChildAbuse: return MTP_inputReportReasonChildAbuse(); | 		case Reason::ChildAbuse: return MTP_inputReportReasonChildAbuse(); | ||||||
| 		case Reason::Pornography: return MTP_inputReportReasonPornography(); | 		case Reason::Pornography: return MTP_inputReportReasonPornography(); | ||||||
|  | @ -203,7 +199,7 @@ void ReportBox::reportFail(const RPCError &error) { | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void ReportBox::updateMaxHeight() { | void ReportBox::updateMaxHeight() { | ||||||
| 	const auto buttonsCount = _ids ? 5 : 4; | 	const auto buttonsCount = 6; | ||||||
| 	auto newHeight = st::boxOptionListPadding.top() + _reasonSpam->getMargins().top() + buttonsCount * _reasonSpam->heightNoMargins() + (buttonsCount - 1) * st::boxOptionListSkip + _reasonSpam->getMargins().bottom() + st::boxOptionListPadding.bottom(); | 	auto newHeight = st::boxOptionListPadding.top() + _reasonSpam->getMargins().top() + buttonsCount * _reasonSpam->heightNoMargins() + (buttonsCount - 1) * st::boxOptionListSkip + _reasonSpam->getMargins().bottom() + st::boxOptionListPadding.bottom(); | ||||||
| 
 | 
 | ||||||
| 	if (_reasonOtherText) { | 	if (_reasonOtherText) { | ||||||
|  |  | ||||||
|  | @ -37,6 +37,7 @@ protected: | ||||||
| private: | private: | ||||||
| 	enum class Reason { | 	enum class Reason { | ||||||
| 		Spam, | 		Spam, | ||||||
|  | 		Fake, | ||||||
| 		Violence, | 		Violence, | ||||||
| 		ChildAbuse, | 		ChildAbuse, | ||||||
| 		Pornography, | 		Pornography, | ||||||
|  | @ -56,6 +57,7 @@ private: | ||||||
| 
 | 
 | ||||||
| 	std::shared_ptr<Ui::RadioenumGroup<Reason>> _reasonGroup; | 	std::shared_ptr<Ui::RadioenumGroup<Reason>> _reasonGroup; | ||||||
| 	object_ptr<Ui::Radioenum<Reason>> _reasonSpam = { nullptr }; | 	object_ptr<Ui::Radioenum<Reason>> _reasonSpam = { nullptr }; | ||||||
|  | 	object_ptr<Ui::Radioenum<Reason>> _reasonFake = { nullptr }; | ||||||
| 	object_ptr<Ui::Radioenum<Reason>> _reasonViolence = { nullptr }; | 	object_ptr<Ui::Radioenum<Reason>> _reasonViolence = { nullptr }; | ||||||
| 	object_ptr<Ui::Radioenum<Reason>> _reasonChildAbuse = { nullptr }; | 	object_ptr<Ui::Radioenum<Reason>> _reasonChildAbuse = { nullptr }; | ||||||
| 	object_ptr<Ui::Radioenum<Reason>> _reasonPornography = { nullptr }; | 	object_ptr<Ui::Radioenum<Reason>> _reasonPornography = { nullptr }; | ||||||
|  |  | ||||||
|  | @ -599,8 +599,8 @@ void GroupCall::handleUpdate(const MTPDupdateGroupCallParticipants &data) { | ||||||
| 		} | 		} | ||||||
| 		_otherParticipantStateValue.fire(Group::ParticipantState{ | 		_otherParticipantStateValue.fire(Group::ParticipantState{ | ||||||
| 			.user = user, | 			.user = user, | ||||||
| 			.mutedByMe = data.is_muted_by_you(), |  | ||||||
| 			.volume = data.vvolume().value_or_empty(), | 			.volume = data.vvolume().value_or_empty(), | ||||||
|  | 			.mutedByMe = data.is_muted_by_you(), | ||||||
| 		}); | 		}); | ||||||
| 	}; | 	}; | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -902,12 +902,14 @@ void MembersController::appendInvitedUsers() { | ||||||
| void MembersController::updateRow( | void MembersController::updateRow( | ||||||
| 		const std::optional<Data::GroupCall::Participant> &was, | 		const std::optional<Data::GroupCall::Participant> &was, | ||||||
| 		const Data::GroupCall::Participant &now) { | 		const Data::GroupCall::Participant &now) { | ||||||
|  | 	auto reorderIfInvitedBeforeIndex = 0; | ||||||
| 	auto countChange = 0; | 	auto countChange = 0; | ||||||
| 	if (const auto row = findRow(now.user)) { | 	if (const auto row = findRow(now.user)) { | ||||||
| 		if (now.speaking && (!was || !was->speaking)) { | 		if (now.speaking && (!was || !was->speaking)) { | ||||||
| 			checkSpeakingRowPosition(row); | 			checkSpeakingRowPosition(row); | ||||||
| 		} | 		} | ||||||
| 		if (row->state() == Row::State::Invited) { | 		if (row->state() == Row::State::Invited) { | ||||||
|  | 			reorderIfInvitedBeforeIndex = row->absoluteIndex(); | ||||||
| 			countChange = 1; | 			countChange = 1; | ||||||
| 		} | 		} | ||||||
| 		updateRow(row, &now); | 		updateRow(row, &now); | ||||||
|  | @ -915,25 +917,27 @@ void MembersController::updateRow( | ||||||
| 		if (row->speaking()) { | 		if (row->speaking()) { | ||||||
| 			delegate()->peerListPrependRow(std::move(row)); | 			delegate()->peerListPrependRow(std::move(row)); | ||||||
| 		} else { | 		} else { | ||||||
|  | 			reorderIfInvitedBeforeIndex = delegate()->peerListFullRowsCount(); | ||||||
|  | 			delegate()->peerListAppendRow(std::move(row)); | ||||||
|  | 		} | ||||||
|  | 		delegate()->peerListRefreshRows(); | ||||||
|  | 		countChange = 1; | ||||||
|  | 	} | ||||||
| 	static constexpr auto kInvited = Row::State::Invited; | 	static constexpr auto kInvited = Row::State::Invited; | ||||||
| 	const auto reorder = [&] { | 	const auto reorder = [&] { | ||||||
| 				const auto count = delegate()->peerListFullRowsCount(); | 		const auto count = reorderIfInvitedBeforeIndex; | ||||||
| 				if (!count) { | 		if (count <= 0) { | ||||||
| 			return false; | 			return false; | ||||||
| 		} | 		} | ||||||
| 				const auto row = delegate()->peerListRowAt(count - 1).get(); | 		const auto row = delegate()->peerListRowAt( | ||||||
|  | 			reorderIfInvitedBeforeIndex - 1).get(); | ||||||
| 		return (static_cast<Row*>(row)->state() == kInvited); | 		return (static_cast<Row*>(row)->state() == kInvited); | ||||||
| 	}(); | 	}(); | ||||||
| 			delegate()->peerListAppendRow(std::move(row)); |  | ||||||
| 	if (reorder) { | 	if (reorder) { | ||||||
| 		delegate()->peerListPartitionRows([](const PeerListRow &row) { | 		delegate()->peerListPartitionRows([](const PeerListRow &row) { | ||||||
| 			return static_cast<const Row&>(row).state() != kInvited; | 			return static_cast<const Row&>(row).state() != kInvited; | ||||||
| 		}); | 		}); | ||||||
| 	} | 	} | ||||||
| 		} |  | ||||||
| 		delegate()->peerListRefreshRows(); |  | ||||||
| 		countChange = 1; |  | ||||||
| 	} |  | ||||||
| 	if (countChange) { | 	if (countChange) { | ||||||
| 		const auto fullCountMin = _fullCountMin.current() + countChange; | 		const auto fullCountMin = _fullCountMin.current() + countChange; | ||||||
| 		if (_fullCountMax.current() < fullCountMin) { | 		if (_fullCountMax.current() < fullCountMin) { | ||||||
|  |  | ||||||
|  | @ -167,7 +167,7 @@ MenuVolumeItem::MenuVolumeItem( | ||||||
| 				std::round(_slider->value() * _maxVolume); | 				std::round(_slider->value() * _maxVolume); | ||||||
| 			if ((localVolume != newVolume) | 			if ((localVolume != newVolume) | ||||||
| 				&& (_cloudVolume == newVolume)) { | 				&& (_cloudVolume == newVolume)) { | ||||||
| 				_changeVolumeRequests.fire(localVolume); | 				_changeVolumeRequests.fire(int(localVolume)); | ||||||
| 			} | 			} | ||||||
| 		} else { | 		} else { | ||||||
| 			setCloudVolume(newVolume); | 			setCloudVolume(newVolume); | ||||||
|  |  | ||||||
|  | @ -1 +1 @@ | ||||||
| Subproject commit a5fb99372184d5f3c00e5e851aaa16d8d28d2ce1 | Subproject commit bda12f2becd2497056d325a897b8285cc57662de | ||||||
		Loading…
	
	Add table
		
		Reference in a new issue
	
	 John Preston
						John Preston