fix: when fetching translation, only consider a message to have included IT if the sent message body matches the message at the end of choreo (#3936)

pull/2245/head
ggurdin 2 months ago committed by GitHub
parent b6e357bf5f
commit 39e01c320b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -223,6 +223,10 @@ class ChoreoRecord {
List<ITStep> get itSteps =>
choreoSteps.where((e) => e.itStep != null).map((e) => e.itStep!).toList();
bool endedWithIT(String sent) {
return includedIT && stepText() == sent;
}
}
/// A new ChoreoRecordStep is saved in the following cases:

@ -590,8 +590,9 @@ class PangeaMessageEvent {
throw Exception("Missing language codes");
}
final includedIT = (originalSent?.choreo?.includedIT ?? false) &&
!(originalSent?.choreo?.includedIGC ?? true);
final includedIT =
(originalSent?.choreo?.endedWithIT(originalSent!.text) ?? false) &&
!(originalSent?.choreo?.includedIGC ?? true);
RepresentationEvent? rep;
if (!includedIT) {

Loading…
Cancel
Save