Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
917d3eea44 |
2 changed files with 22 additions and 6 deletions
|
|
@ -121,9 +121,16 @@ class RoomChatController extends AsyncNotifier<IList<Event>?> {
|
|||
required RelationType relationType,
|
||||
Event? relation,
|
||||
}) async {
|
||||
final attachment = ref.watch(AttachmentController.provider(roomId));
|
||||
Content? baseContent;
|
||||
if (relationType == .edit) {
|
||||
baseContent = relation?.content;
|
||||
} else {
|
||||
final attachment = ref.watch(AttachmentController.provider(roomId));
|
||||
if (attachment != null && attachment.$2 == null) return;
|
||||
|
||||
if (attachment != null && attachment.$2 == null) return;
|
||||
baseContent = attachment?.$2;
|
||||
ref.invalidate(AttachmentController.provider(roomId));
|
||||
}
|
||||
|
||||
var taggedMessage = text;
|
||||
|
||||
|
|
@ -141,7 +148,7 @@ class RoomChatController extends AsyncNotifier<IList<Event>?> {
|
|||
final event = await client.sendMessage(
|
||||
SendMessageRequest(
|
||||
roomId: roomId,
|
||||
baseContent: attachment?.$2,
|
||||
baseContent: baseContent,
|
||||
mentions: Mentions(
|
||||
userIds: [
|
||||
if (shouldMention == true &&
|
||||
|
|
@ -158,8 +165,6 @@ class RoomChatController extends AsyncNotifier<IList<Event>?> {
|
|||
),
|
||||
);
|
||||
|
||||
ref.invalidate(AttachmentController.provider(roomId));
|
||||
|
||||
ref
|
||||
.watch(RoomsController.provider.notifier)
|
||||
.update(
|
||||
|
|
|
|||
11
lib/widgets/mxc_image.dart
Normal file
11
lib/widgets/mxc_image.dart
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
import "package:flutter/material.dart";
|
||||
import "package:flutter_riverpod/flutter_riverpod.dart";
|
||||
|
||||
class MxcImage extends ConsumerWidget {
|
||||
const MxcImage({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
return const Placeholder();
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue