Ignore old webrtc invites

This commit is contained in:
Christian Pauly 2020-08-18 10:07:47 +02:00
parent 0d159c2db4
commit 09ffa09404
1 changed files with 14 additions and 9 deletions

View File

@ -983,15 +983,20 @@ class Client extends MatrixApi {
final rawUnencryptedEvent = update.content;
if (rawUnencryptedEvent['type'] == EventTypes.CallInvite) {
onCallInvite.add(Event.fromJson(rawUnencryptedEvent, room, sortOrder));
} else if (rawUnencryptedEvent['type'] == EventTypes.CallHangup) {
onCallHangup.add(Event.fromJson(rawUnencryptedEvent, room, sortOrder));
} else if (rawUnencryptedEvent['type'] == EventTypes.CallAnswer) {
onCallAnswer.add(Event.fromJson(rawUnencryptedEvent, room, sortOrder));
} else if (rawUnencryptedEvent['type'] == EventTypes.CallCandidates) {
onCallCandidates
.add(Event.fromJson(rawUnencryptedEvent, room, sortOrder));
if (prevBatch != null && type == 'timeline') {
if (rawUnencryptedEvent['type'] == EventTypes.CallInvite) {
onCallInvite
.add(Event.fromJson(rawUnencryptedEvent, room, sortOrder));
} else if (rawUnencryptedEvent['type'] == EventTypes.CallHangup) {
onCallHangup
.add(Event.fromJson(rawUnencryptedEvent, room, sortOrder));
} else if (rawUnencryptedEvent['type'] == EventTypes.CallAnswer) {
onCallAnswer
.add(Event.fromJson(rawUnencryptedEvent, room, sortOrder));
} else if (rawUnencryptedEvent['type'] == EventTypes.CallCandidates) {
onCallCandidates
.add(Event.fromJson(rawUnencryptedEvent, room, sortOrder));
}
}
}
}