|
|
|
@ -63,15 +63,8 @@ class PinnedEvents extends StatelessWidget {
|
|
|
|
|
future: controller.room.getEventById(pinnedEventIds.last),
|
|
|
|
|
builder: (context, snapshot) {
|
|
|
|
|
final event = snapshot.data;
|
|
|
|
|
return FutureBuilder<String>(
|
|
|
|
|
future: event?.calcLocalizedBody(
|
|
|
|
|
MatrixLocals(L10n.of(context)!),
|
|
|
|
|
withSenderNamePrefix: true,
|
|
|
|
|
hideReply: true,
|
|
|
|
|
),
|
|
|
|
|
builder: (context, snapshot) => ChatAppBarListTile(
|
|
|
|
|
title: snapshot.data ??
|
|
|
|
|
event?.calcLocalizedBodyFallback(
|
|
|
|
|
return ChatAppBarListTile(
|
|
|
|
|
title: event?.calcLocalizedBodyFallback(
|
|
|
|
|
MatrixLocals(L10n.of(context)!),
|
|
|
|
|
withSenderNamePrefix: true,
|
|
|
|
|
hideReply: true,
|
|
|
|
@ -83,13 +76,11 @@ class PinnedEvents extends StatelessWidget {
|
|
|
|
|
color: Theme.of(context).colorScheme.onSurfaceVariant,
|
|
|
|
|
icon: const Icon(Icons.push_pin),
|
|
|
|
|
tooltip: L10n.of(context)!.unpin,
|
|
|
|
|
onPressed:
|
|
|
|
|
controller.room.canSendEvent(EventTypes.RoomPinnedEvents)
|
|
|
|
|
onPressed: controller.room.canSendEvent(EventTypes.RoomPinnedEvents)
|
|
|
|
|
? () => controller.unpinEvent(event!.eventId)
|
|
|
|
|
: null,
|
|
|
|
|
),
|
|
|
|
|
onTap: () => _displayPinnedEventsDialog(context),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|