refactor: Fix new lints from flutter 3.27
This commit is contained in:
parent
168433a709
commit
04a46226cb
|
|
@ -27,7 +27,9 @@ extension JsonSignatureCheckExtension on Map<String, dynamic> {
|
||||||
final signatures = this['signatures'];
|
final signatures = this['signatures'];
|
||||||
if (signatures == null ||
|
if (signatures == null ||
|
||||||
signatures is! Map<String, dynamic> ||
|
signatures is! Map<String, dynamic> ||
|
||||||
!signatures.containsKey(userId)) return false;
|
!signatures.containsKey(userId)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
remove('unsigned');
|
remove('unsigned');
|
||||||
remove('signatures');
|
remove('signatures');
|
||||||
if (!signatures[userId].containsKey('ed25519:$deviceId')) return false;
|
if (!signatures[userId].containsKey('ed25519:$deviceId')) return false;
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,9 @@ extension DehydratedDeviceHandler on Client {
|
||||||
// Only handle devices we understand
|
// Only handle devices we understand
|
||||||
// In the future we might want to migrate to a newer format here
|
// In the future we might want to migrate to a newer format here
|
||||||
if (device.deviceData?.tryGet<String>('algorithm') !=
|
if (device.deviceData?.tryGet<String>('algorithm') !=
|
||||||
_dehydratedDeviceAlgorithm) return;
|
_dehydratedDeviceAlgorithm) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Verify that the device is cross-signed
|
// Verify that the device is cross-signed
|
||||||
final dehydratedDeviceIdentity =
|
final dehydratedDeviceIdentity =
|
||||||
|
|
|
||||||
|
|
@ -2567,7 +2567,9 @@ class Client extends MatrixApi {
|
||||||
if (event.event.roomID != roomId) continue;
|
if (event.event.roomID != roomId) continue;
|
||||||
if (!sessionIds.contains(
|
if (!sessionIds.contains(
|
||||||
event.event.content['content']?['session_id'],
|
event.event.content['content']?['session_id'],
|
||||||
)) continue;
|
)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
final decryptedEvent = await event.event.decrypt(room);
|
final decryptedEvent = await event.event.decrypt(room);
|
||||||
if (decryptedEvent.content.tryGet<String>('type') !=
|
if (decryptedEvent.content.tryGet<String>('type') !=
|
||||||
|
|
|
||||||
|
|
@ -115,7 +115,9 @@ class ReceiptEventContent {
|
||||||
|
|
||||||
if (userId is! String ||
|
if (userId is! String ||
|
||||||
!userId.isValidMatrixId ||
|
!userId.isValidMatrixId ||
|
||||||
receiptContent is! Map) continue;
|
receiptContent is! Map) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
final ts = receiptContent['ts'];
|
final ts = receiptContent['ts'];
|
||||||
final threadId = receiptContent['thread_id'];
|
final threadId = receiptContent['thread_id'];
|
||||||
|
|
|
||||||
|
|
@ -518,7 +518,9 @@ class Room {
|
||||||
// There is no known event or the last event is only a state fallback event,
|
// There is no known event or the last event is only a state fallback event,
|
||||||
// we assume there is no new messages.
|
// we assume there is no new messages.
|
||||||
if (lastEvent == null ||
|
if (lastEvent == null ||
|
||||||
!client.roomPreviewLastEvents.contains(lastEvent.type)) return false;
|
!client.roomPreviewLastEvents.contains(lastEvent.type)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// Read marker is on the last event so no new messages.
|
// Read marker is on the last event so no new messages.
|
||||||
if (lastEvent.receipts
|
if (lastEvent.receipts
|
||||||
|
|
|
||||||
|
|
@ -263,7 +263,9 @@ class Timeline {
|
||||||
|
|
||||||
if (!allowNewEvent) {
|
if (!allowNewEvent) {
|
||||||
if (resp.start == resp.end ||
|
if (resp.start == resp.end ||
|
||||||
(resp.end == null && direction == Direction.f)) allowNewEvent = true;
|
(resp.end == null && direction == Direction.f)) {
|
||||||
|
allowNewEvent = true;
|
||||||
|
}
|
||||||
|
|
||||||
if (allowNewEvent) {
|
if (allowNewEvent) {
|
||||||
Logs().d('We now allow sync update into the timeline.');
|
Logs().d('We now allow sync update into the timeline.');
|
||||||
|
|
@ -566,7 +568,9 @@ class Timeline {
|
||||||
events.indexWhere(
|
events.indexWhere(
|
||||||
(e) => e.eventId == eventUpdate.content['event_id'],
|
(e) => e.eventId == eventUpdate.content['event_id'],
|
||||||
) !=
|
) !=
|
||||||
-1) return;
|
-1) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
var index = events.length;
|
var index = events.length;
|
||||||
if (eventUpdate.type == EventUpdateType.history) {
|
if (eventUpdate.type == EventUpdateType.history) {
|
||||||
events.add(newEvent);
|
events.add(newEvent);
|
||||||
|
|
|
||||||
|
|
@ -203,7 +203,6 @@ abstract class EventLocalizations {
|
||||||
case RoomMemberChangeType.knock:
|
case RoomMemberChangeType.knock:
|
||||||
return i18n.hasKnocked(targetName);
|
return i18n.hasKnocked(targetName);
|
||||||
case RoomMemberChangeType.other:
|
case RoomMemberChangeType.other:
|
||||||
default:
|
|
||||||
return userIsTarget
|
return userIsTarget
|
||||||
? i18n.youJoinedTheChat
|
? i18n.youJoinedTheChat
|
||||||
: i18n.joinedTheChat(targetName);
|
: i18n.joinedTheChat(targetName);
|
||||||
|
|
|
||||||
|
|
@ -153,7 +153,6 @@ class _MemberCountCondition {
|
||||||
case _CountComparisonOp.lt:
|
case _CountComparisonOp.lt:
|
||||||
return memberCount < count;
|
return memberCount < count;
|
||||||
case _CountComparisonOp.eq:
|
case _CountComparisonOp.eq:
|
||||||
default:
|
|
||||||
return memberCount == count;
|
return memberCount == count;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -650,7 +650,6 @@ class MeshBackend extends CallBackend {
|
||||||
await call.setLocalVideoMuted(muted);
|
await call.setLocalVideoMuted(muted);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1016,7 +1016,9 @@ class CallSession {
|
||||||
// when a call crash and this call is already terminated the currentCId is null.
|
// when a call crash and this call is already terminated the currentCId is null.
|
||||||
// So don't return bc the hangup or reject will not proceed anymore.
|
// So don't return bc the hangup or reject will not proceed anymore.
|
||||||
if (voip.currentCID != null &&
|
if (voip.currentCID != null &&
|
||||||
voip.currentCID != VoipId(roomId: room.id, callId: callId)) return;
|
voip.currentCID != VoipId(roomId: room.id, callId: callId)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
voip.currentCID = null;
|
voip.currentCID = null;
|
||||||
voip.incomingCallRoomId.removeWhere((key, value) => value == callId);
|
voip.incomingCallRoomId.removeWhere((key, value) => value == callId);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue