mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2024-11-23 20:49:26 +01:00
chore: Update SDK
This commit is contained in:
parent
bcf46d4d8c
commit
f884e8082f
@ -468,7 +468,7 @@ class ChatController extends State<Chat> {
|
||||
await showFutureLoadingDialog(
|
||||
context: context,
|
||||
future: () async {
|
||||
if (event.status > 0) {
|
||||
if (event.status.isSent) {
|
||||
if (event.canRedact) {
|
||||
await event.redactEvent();
|
||||
} else {
|
||||
@ -505,7 +505,7 @@ class ChatController extends State<Chat> {
|
||||
}
|
||||
|
||||
bool get canEditSelectedEvents {
|
||||
if (selectedEvents.length != 1 || selectedEvents.first.status < 1) {
|
||||
if (selectedEvents.length != 1 || !selectedEvents.first.status.isSent) {
|
||||
return false;
|
||||
}
|
||||
return currentRoomBundle
|
||||
@ -527,12 +527,12 @@ class ChatController extends State<Chat> {
|
||||
|
||||
void sendAgainAction() {
|
||||
final event = selectedEvents.first;
|
||||
if (event.status == -1) {
|
||||
if (event.status.isError) {
|
||||
event.sendAgain();
|
||||
}
|
||||
final allEditEvents = event
|
||||
.aggregatedEvents(timeline, RelationshipTypes.edit)
|
||||
.where((e) => e.status == -1);
|
||||
.where((e) => e.status.isError);
|
||||
for (final e in allEditEvents) {
|
||||
e.sendAgain();
|
||||
}
|
||||
|
@ -535,8 +535,7 @@ class ChatView extends StatelessWidget {
|
||||
? controller.selectedEvents.first
|
||||
.getDisplayEvent(
|
||||
controller.timeline)
|
||||
.status >
|
||||
0
|
||||
.status.isSent
|
||||
? SizedBox(
|
||||
height: 56,
|
||||
child: TextButton(
|
||||
|
@ -461,8 +461,7 @@ class BackgroundPush {
|
||||
Future<bool> eventExists(String roomId, String eventId) async {
|
||||
final room = client.getRoomById(roomId);
|
||||
if (room == null) return false;
|
||||
return (await client.database.getEventById(client.id, eventId, room)) !=
|
||||
null;
|
||||
return (await client.database.getEventById(eventId, room)) != null;
|
||||
}
|
||||
|
||||
/// Workaround for the problem that local notification IDs must be int but we
|
||||
@ -579,7 +578,7 @@ class BackgroundPush {
|
||||
throw 'Room not found';
|
||||
}
|
||||
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'];
|
||||
|
||||
|
@ -16,7 +16,7 @@ extension LocalizedBody on Event {
|
||||
}
|
||||
|
||||
IconData get statusIcon {
|
||||
switch (status) {
|
||||
switch (status.intValue) {
|
||||
case -1:
|
||||
return Icons.error_outline;
|
||||
case 0:
|
||||
|
@ -36,8 +36,8 @@ class FlutterMatrixHiveStore extends FamedlySdkHiveDatabase {
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> clear(int clientId) async {
|
||||
await super.clear(clientId);
|
||||
Future<void> clear() async {
|
||||
await super.clear();
|
||||
await _customBox.deleteAll(_customBox.keys);
|
||||
await _customBox.close();
|
||||
}
|
||||
@ -84,7 +84,7 @@ class FlutterMatrixHiveStore extends FamedlySdkHiveDatabase {
|
||||
await db.open();
|
||||
} catch (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();
|
||||
}
|
||||
return db;
|
||||
|
@ -75,7 +75,7 @@ class Message extends StatelessWidget {
|
||||
color = Colors.transparent;
|
||||
textColor = Theme.of(context).textTheme.bodyText2.color;
|
||||
} else if (ownMessage) {
|
||||
color = displayEvent.status == -1
|
||||
color = displayEvent.status.isError
|
||||
? Colors.redAccent
|
||||
: Theme.of(context).primaryColor;
|
||||
}
|
||||
@ -125,7 +125,7 @@ class Message extends StatelessWidget {
|
||||
type: 'm.room.message',
|
||||
room: event.room,
|
||||
roomId: event.roomId,
|
||||
status: 1,
|
||||
status: EventStatus.sent,
|
||||
originServerTs: DateTime.now(),
|
||||
);
|
||||
return InkWell(
|
||||
|
@ -748,7 +748,7 @@ packages:
|
||||
name: matrix
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.5.5"
|
||||
version: "0.6.1"
|
||||
matrix_api_lite:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
@ -45,7 +45,7 @@ dependencies:
|
||||
intl: any
|
||||
localstorage: ^4.0.0+1
|
||||
lottie: ^1.2.1
|
||||
matrix: ^0.5.5
|
||||
matrix: ^0.6.1
|
||||
matrix_link_text: ^1.0.2
|
||||
native_imaging:
|
||||
git: https://gitlab.com/famedly/libraries/native_imaging.git
|
||||
|
Loading…
Reference in New Issue
Block a user