Compare commits
5 changed files with 29 additions and 49 deletions
|
|
@ -10,7 +10,6 @@ import "package:nexus/controllers/recent_emoji.dart";
|
|||
import "package:nexus/controllers/rooms.dart";
|
||||
import "package:nexus/controllers/room_chat.dart";
|
||||
import "package:nexus/controllers/via.dart";
|
||||
import "package:nexus/helpers/extensions/event_id_is_fake.dart";
|
||||
import "package:nexus/models/content/message.dart";
|
||||
import "package:nexus/models/event.dart";
|
||||
import "package:nexus/models/relation_type.dart";
|
||||
|
|
@ -230,7 +229,7 @@ extension BuildEventOptions on Event {
|
|||
.redaction(targetUser: sender, roomId: roomId),
|
||||
),
|
||||
) &&
|
||||
!eventId.isFake)
|
||||
!eventId.startsWith("~"))
|
||||
PopupMenuItem(
|
||||
onTap: () => showReasonDialog(
|
||||
title: "Delete Message",
|
||||
|
|
@ -247,7 +246,7 @@ extension BuildEventOptions on Event {
|
|||
),
|
||||
),
|
||||
|
||||
if (eventId.isFake)
|
||||
if (eventId.startsWith("~"))
|
||||
PopupMenuItem(
|
||||
onTap: () => ref.watch(notifier).hideClientSticky(rowId),
|
||||
child: ListTile(
|
||||
|
|
|
|||
|
|
@ -1,3 +0,0 @@
|
|||
extension EventIdIsFake on String {
|
||||
bool get isFake => startsWith("~") || startsWith("\$gomuks");
|
||||
}
|
||||
|
|
@ -18,21 +18,18 @@ class const EventPreview(final Event event, {super.key})
|
|||
if (event.content is MessageContent) MessageAvatar(event),
|
||||
|
||||
Flexible(
|
||||
child: Row(
|
||||
child: Wrap(
|
||||
crossAxisAlignment: .center,
|
||||
mainAxisSize: .min,
|
||||
spacing: 8,
|
||||
runSpacing: 2,
|
||||
children: [
|
||||
if (event.content is MessageContent)
|
||||
Flexible(child: MessageDisplayname(event)),
|
||||
Flexible(
|
||||
child: EventRenderer(
|
||||
if (event.content is MessageContent) MessageDisplayname(event),
|
||||
EventRenderer(
|
||||
event.rowId,
|
||||
roomId: event.roomId,
|
||||
textOnly: true,
|
||||
maxLines: 1,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
|
|
|||
|
|
@ -1,15 +1,11 @@
|
|||
import "package:material_ui/material_ui.dart";
|
||||
|
||||
class const Loading({super.key, final double? dimension})
|
||||
extends StatelessWidget {
|
||||
class const Loading({super.key, final double? height}) extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) => Center(
|
||||
child: Padding(
|
||||
padding: .all(16),
|
||||
child: SizedBox.square(
|
||||
dimension: dimension,
|
||||
child: CircularProgressIndicator(),
|
||||
),
|
||||
child: SizedBox(height: height, child: CircularProgressIndicator()),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@ import "package:nexus/widgets/html/html.dart";
|
|||
import "package:nexus/widgets/lazy_loading/message_avatar.dart";
|
||||
import "package:nexus/widgets/lazy_loading/message_displayname.dart";
|
||||
import "package:nexus/widgets/linkified_text.dart";
|
||||
import "package:nexus/widgets/loading.dart";
|
||||
import "package:nexus/widgets/message_image.dart";
|
||||
import "package:nexus/widgets/reaction_row.dart";
|
||||
import "package:nexus/widgets/timestamp.dart";
|
||||
|
|
@ -198,12 +197,6 @@ class const MessageRenderer(
|
|||
onTap: onTapReply,
|
||||
child: Padding(
|
||||
padding: .symmetric(vertical: 8, horizontal: 12),
|
||||
child: SizedBox(
|
||||
height: 32,
|
||||
child: OverflowBox(
|
||||
alignment: .centerLeft,
|
||||
minHeight: 0,
|
||||
maxHeight: .infinity,
|
||||
child: switch (ref.watch(
|
||||
EventController.provider(
|
||||
.new(
|
||||
|
|
@ -220,13 +213,11 @@ class const MessageRenderer(
|
|||
"An error occurred while fetching the reply",
|
||||
style: errorStyle,
|
||||
),
|
||||
_ => Loading(dimension: 12),
|
||||
_ => Text("Fetching event..."),
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
rendered,
|
||||
if (!textOnly) ReactionRow(event),
|
||||
],
|
||||
|
|
|
|||
Loading…
Reference in a new issue