Hide reply action in chats where user can't send messages

This commit is contained in:
Kelrap 2025-06-11 13:11:12 -04:00
parent 1f8772dd07
commit 1a69972b4c
2 changed files with 10 additions and 2 deletions

View file

@ -1390,6 +1390,12 @@ class ChatController extends State<ChatPageWithRoom>
return true;
}
// #Pangea
bool get canReplySelectedEvents {
return room.canSendDefaultMessages;
}
// Pangea#
bool get canPinSelectedEvents {
if (isArchived ||
!room.canChangeStateEvent(EventTypes.RoomPinnedEvents) ||
@ -1618,7 +1624,8 @@ class ChatController extends State<ChatPageWithRoom>
if (timeline == null ||
events.any(
(e) => e.aggregatedEvents(timeline!, RelationshipTypes.reaction).any(
(re) => re.content.tryGetMap('m.relates_to')?['key'] == emoji),
(re) => re.content.tryGetMap('m.relates_to')?['key'] == emoji,
),
)) {
return;
}

View file

@ -63,7 +63,8 @@ class OverlayHeaderState extends State<OverlayHeader> {
padding: const EdgeInsets.symmetric(vertical: 8.0),
child: Row(
children: [
if (controller.selectedEvents.length == 1)
if (controller.selectedEvents.length == 1 &&
controller.canReplySelectedEvents)
IconButton(
icon: const Icon(Symbols.reply_all),
tooltip: l10n.reply,