Hide reply action in chats where user can't send messages
This commit is contained in:
parent
1f8772dd07
commit
1a69972b4c
2 changed files with 10 additions and 2 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue