bool NotificationChecker::NotificationEntry::applies() const
{
	bool channelApplies = channel.isEmpty() || channel == VERSION_CHANNEL;
	bool buildtypeApplies = buildtype.isEmpty() || buildtype == VERSION_BUILD_TYPE;
	bool fromApplies =
		from.isEmpty() || from == FULL_VERSION_STR || !versionLessThan(FULL_VERSION_STR, from);
	bool toApplies =
		to.isEmpty() || to == FULL_VERSION_STR || !versionLessThan(to, FULL_VERSION_STR);
	return channelApplies && buildtypeApplies && fromApplies && toApplies;
}
Esempio n. 2
0
bool NotificationChecker::NotificationEntry::applies() const
{
	MultiMCVersion version = MMC->version();
	bool channelApplies = channel.isEmpty() || channel == version.channel;
	bool platformApplies = platform.isEmpty() || platform == version.platform;
	bool fromApplies =
		from.isEmpty() || from == FULL_VERSION_STR || !versionLessThan(FULL_VERSION_STR, from);
	bool toApplies =
		to.isEmpty() || to == FULL_VERSION_STR || !versionLessThan(to, FULL_VERSION_STR);
	return channelApplies && platformApplies && fromApplies && toApplies;
}