Fix wrong call types

This commit is contained in:
Christian Pauly 2020-08-15 15:10:36 +02:00
parent a288216e03
commit 215563ab92
3 changed files with 12 additions and 12 deletions

View file

@ -36,9 +36,9 @@ abstract class EventTypes {
static const String HistoryVisibility = 'm.room.history_visibility';
static const String Encryption = 'm.room.encryption';
static const String Encrypted = 'm.room.encrypted';
static const String CallInvite = 'm.room.call.invite';
static const String CallAnswer = 'm.room.call.answer';
static const String CallCandidates = 'm.room.call.candidates';
static const String CallHangup = 'm.room.call.hangup';
static const String CallInvite = 'm.call.invite';
static const String CallAnswer = 'm.call.answer';
static const String CallCandidates = 'm.call.candidates';
static const String CallHangup = 'm.call.hangup';
static const String Unknown = 'm.unknown';
}

View file

@ -981,13 +981,13 @@ class Client extends MatrixApi {
}
onEvent.add(update);
if (event['type'] == 'm.call.invite') {
if (event['type'] == EventTypes.CallInvite) {
onCallInvite.add(Event.fromJson(event, room, sortOrder));
} else if (event['type'] == 'm.call.hangup') {
} else if (event['type'] == EventTypes.CallHangup) {
onCallHangup.add(Event.fromJson(event, room, sortOrder));
} else if (event['type'] == 'm.call.answer') {
} else if (event['type'] == EventTypes.CallAnswer) {
onCallAnswer.add(Event.fromJson(event, room, sortOrder));
} else if (event['type'] == 'm.call.candidates') {
} else if (event['type'] == EventTypes.CallCandidates) {
onCallCandidates.add(Event.fromJson(event, room, sortOrder));
}
}

View file

@ -1992,13 +1992,13 @@ class FakeMatrixApi extends MockClient {
(var req) => {},
'/client/r0/rooms/!localpart%3Aserver.abc/state/m.room.guest_access':
(var req) => {},
'/client/r0/rooms/!localpart%3Aserver.abc/send/m.room.call.invite/1234':
'/client/r0/rooms/!localpart%3Aserver.abc/send/m.call.invite/1234':
(var req) => {},
'/client/r0/rooms/!localpart%3Aserver.abc/send/m.room.call.answer/1234':
'/client/r0/rooms/!localpart%3Aserver.abc/send/m.call.answer/1234':
(var req) => {},
'/client/r0/rooms/!localpart%3Aserver.abc/send/m.room.call.candidates/1234':
'/client/r0/rooms/!localpart%3Aserver.abc/send/m.call.candidates/1234':
(var req) => {},
'/client/r0/rooms/!localpart%3Aserver.abc/send/m.room.call.hangup/1234':
'/client/r0/rooms/!localpart%3Aserver.abc/send/m.call.hangup/1234':
(var req) => {},
'/client/r0/rooms/!1234%3Aexample.com/redact/1143273582443PhrSn%3Aexample.org/1234':
(var req) => {'event_id': '1234'},