Add call state localizations

This commit is contained in:
Christian Pauly 2020-08-15 14:24:44 +02:00
parent 61b32e0bd9
commit a288216e03
4 changed files with 64 additions and 0 deletions

View file

@ -584,6 +584,18 @@ class Event extends MatrixEvent {
localizedBody += '. ' + i18n.needPantalaimonWarning; localizedBody += '. ' + i18n.needPantalaimonWarning;
} }
break; break;
case EventTypes.CallAnswer:
localizedBody = i18n.answeredTheCall(senderName);
break;
case EventTypes.CallHangup:
localizedBody = i18n.endedTheCall(senderName);
break;
case EventTypes.CallInvite:
localizedBody = i18n.startedACall(senderName);
break;
case EventTypes.CallCandidates:
localizedBody = i18n.sentCallInformations(senderName);
break;
case EventTypes.Encrypted: case EventTypes.Encrypted:
case EventTypes.Message: case EventTypes.Message:
switch (messageType) { switch (messageType) {

View file

@ -109,6 +109,14 @@ abstract class MatrixLocalizations {
String couldNotDecryptMessage(String errorText); String couldNotDecryptMessage(String errorText);
String unknownEvent(String typeKey); String unknownEvent(String typeKey);
String startedACall(String senderName);
String endedTheCall(String senderName);
String answeredTheCall(String senderName);
String sentCallInformations(String senderName);
} }
extension HistoryVisibilityDisplayString on HistoryVisibility { extension HistoryVisibilityDisplayString on HistoryVisibility {

View file

@ -306,4 +306,28 @@ class FakeMatrixLocalizations extends MatrixLocalizations {
@override @override
// TODO: implement you // TODO: implement you
String get you => null; String get you => null;
@override
String answeredTheCall(String senderName) {
// TODO: implement answeredTheCall
return null;
}
@override
String endedTheCall(String senderName) {
// TODO: implement endedTheCall
return null;
}
@override
String sentCallInformations(String senderName) {
// TODO: implement sentCallInformations
return null;
}
@override
String startedACall(String senderName) {
// TODO: implement startedACall
return null;
}
} }

View file

@ -205,4 +205,24 @@ class MatrixDefaultLocalizations extends MatrixLocalizations {
@override @override
String get you => 'You'; String get you => 'You';
@override
String answeredTheCall(String senderName) {
return 'answeredTheCall';
}
@override
String endedTheCall(String senderName) {
return 'endedTheCall';
}
@override
String sentCallInformations(String senderName) {
return 'sentCallInformations';
}
@override
String startedACall(String senderName) {
return 'startedACall';
}
} }