chore: Update SDK

This commit is contained in:
Krille Fear 2021-10-25 10:46:58 +02:00
parent bcf46d4d8c
commit f884e8082f
8 changed files with 15 additions and 17 deletions

View File

@ -468,7 +468,7 @@ class ChatController extends State<Chat> {
await showFutureLoadingDialog( await showFutureLoadingDialog(
context: context, context: context,
future: () async { future: () async {
if (event.status > 0) { if (event.status.isSent) {
if (event.canRedact) { if (event.canRedact) {
await event.redactEvent(); await event.redactEvent();
} else { } else {
@ -505,7 +505,7 @@ class ChatController extends State<Chat> {
} }
bool get canEditSelectedEvents { bool get canEditSelectedEvents {
if (selectedEvents.length != 1 || selectedEvents.first.status < 1) { if (selectedEvents.length != 1 || !selectedEvents.first.status.isSent) {
return false; return false;
} }
return currentRoomBundle return currentRoomBundle
@ -527,12 +527,12 @@ class ChatController extends State<Chat> {
void sendAgainAction() { void sendAgainAction() {
final event = selectedEvents.first; final event = selectedEvents.first;
if (event.status == -1) { if (event.status.isError) {
event.sendAgain(); event.sendAgain();
} }
final allEditEvents = event final allEditEvents = event
.aggregatedEvents(timeline, RelationshipTypes.edit) .aggregatedEvents(timeline, RelationshipTypes.edit)
.where((e) => e.status == -1); .where((e) => e.status.isError);
for (final e in allEditEvents) { for (final e in allEditEvents) {
e.sendAgain(); e.sendAgain();
} }

View File

@ -535,8 +535,7 @@ class ChatView extends StatelessWidget {
? controller.selectedEvents.first ? controller.selectedEvents.first
.getDisplayEvent( .getDisplayEvent(
controller.timeline) controller.timeline)
.status > .status.isSent
0
? SizedBox( ? SizedBox(
height: 56, height: 56,
child: TextButton( child: TextButton(

View File

@ -461,8 +461,7 @@ class BackgroundPush {
Future<bool> eventExists(String roomId, String eventId) async { Future<bool> eventExists(String roomId, String eventId) async {
final room = client.getRoomById(roomId); final room = client.getRoomById(roomId);
if (room == null) return false; if (room == null) return false;
return (await client.database.getEventById(client.id, eventId, room)) != return (await client.database.getEventById(eventId, room)) != null;
null;
} }
/// Workaround for the problem that local notification IDs must be int but we /// Workaround for the problem that local notification IDs must be int but we
@ -579,7 +578,7 @@ class BackgroundPush {
throw 'Room not found'; throw 'Room not found';
} }
await room.postLoad(); await room.postLoad();
final event = await client.database.getEventById(client.id, eventId, room); final event = await client.database.getEventById(eventId, room);
final activeRoomId = router.currentState.pathParameters['roomid']; final activeRoomId = router.currentState.pathParameters['roomid'];

View File

@ -16,7 +16,7 @@ extension LocalizedBody on Event {
} }
IconData get statusIcon { IconData get statusIcon {
switch (status) { switch (status.intValue) {
case -1: case -1:
return Icons.error_outline; return Icons.error_outline;
case 0: case 0:

View File

@ -36,8 +36,8 @@ class FlutterMatrixHiveStore extends FamedlySdkHiveDatabase {
} }
@override @override
Future<void> clear(int clientId) async { Future<void> clear() async {
await super.clear(clientId); await super.clear();
await _customBox.deleteAll(_customBox.keys); await _customBox.deleteAll(_customBox.keys);
await _customBox.close(); await _customBox.close();
} }
@ -84,7 +84,7 @@ class FlutterMatrixHiveStore extends FamedlySdkHiveDatabase {
await db.open(); await db.open();
} catch (e, s) { } catch (e, s) {
Logs().e('Unable to open Hive. Delete and try again...', e, s); Logs().e('Unable to open Hive. Delete and try again...', e, s);
await db.clear(client.id); await db.clear();
await db.open(); await db.open();
} }
return db; return db;

View File

@ -75,7 +75,7 @@ class Message extends StatelessWidget {
color = Colors.transparent; color = Colors.transparent;
textColor = Theme.of(context).textTheme.bodyText2.color; textColor = Theme.of(context).textTheme.bodyText2.color;
} else if (ownMessage) { } else if (ownMessage) {
color = displayEvent.status == -1 color = displayEvent.status.isError
? Colors.redAccent ? Colors.redAccent
: Theme.of(context).primaryColor; : Theme.of(context).primaryColor;
} }
@ -125,7 +125,7 @@ class Message extends StatelessWidget {
type: 'm.room.message', type: 'm.room.message',
room: event.room, room: event.room,
roomId: event.roomId, roomId: event.roomId,
status: 1, status: EventStatus.sent,
originServerTs: DateTime.now(), originServerTs: DateTime.now(),
); );
return InkWell( return InkWell(

View File

@ -748,7 +748,7 @@ packages:
name: matrix name: matrix
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.5.5" version: "0.6.1"
matrix_api_lite: matrix_api_lite:
dependency: transitive dependency: transitive
description: description:

View File

@ -45,7 +45,7 @@ dependencies:
intl: any intl: any
localstorage: ^4.0.0+1 localstorage: ^4.0.0+1
lottie: ^1.2.1 lottie: ^1.2.1
matrix: ^0.5.5 matrix: ^0.6.1
matrix_link_text: ^1.0.2 matrix_link_text: ^1.0.2
native_imaging: native_imaging:
git: https://gitlab.com/famedly/libraries/native_imaging.git git: https://gitlab.com/famedly/libraries/native_imaging.git