|
|
@ -162,7 +162,7 @@ class MessageContent extends StatelessWidget {
|
|
|
|
return _ButtonContent(
|
|
|
|
return _ButtonContent(
|
|
|
|
textColor: buttonTextColor,
|
|
|
|
textColor: buttonTextColor,
|
|
|
|
onPressed: () => _verifyOrRequestKey(context),
|
|
|
|
onPressed: () => _verifyOrRequestKey(context),
|
|
|
|
icon: const Icon(Icons.lock_outline),
|
|
|
|
icon: '🔒',
|
|
|
|
label: L10n.of(context)!.encrypted,
|
|
|
|
label: L10n.of(context)!.encrypted,
|
|
|
|
fontSize: fontSize,
|
|
|
|
fontSize: fontSize,
|
|
|
|
);
|
|
|
|
);
|
|
|
@ -208,12 +208,19 @@ class MessageContent extends StatelessWidget {
|
|
|
|
return FutureBuilder<User?>(
|
|
|
|
return FutureBuilder<User?>(
|
|
|
|
future: event.redactedBecause?.fetchSenderUser(),
|
|
|
|
future: event.redactedBecause?.fetchSenderUser(),
|
|
|
|
builder: (context, snapshot) {
|
|
|
|
builder: (context, snapshot) {
|
|
|
|
|
|
|
|
final reason =
|
|
|
|
|
|
|
|
event.redactedBecause?.content.tryGet<String>('reason');
|
|
|
|
|
|
|
|
final redactedBy = snapshot.data?.calcDisplayname() ??
|
|
|
|
|
|
|
|
event.redactedBecause?.senderId.localpart ??
|
|
|
|
|
|
|
|
L10n.of(context)!.user;
|
|
|
|
return _ButtonContent(
|
|
|
|
return _ButtonContent(
|
|
|
|
label: L10n.of(context)!.redactedAnEvent(
|
|
|
|
label: reason == null
|
|
|
|
snapshot.data?.calcDisplayname() ??
|
|
|
|
? L10n.of(context)!.redactedBy(redactedBy)
|
|
|
|
event.senderFromMemoryOrFallback.calcDisplayname(),
|
|
|
|
: L10n.of(context)!.redactedByBecause(
|
|
|
|
),
|
|
|
|
redactedBy,
|
|
|
|
icon: const Icon(Icons.delete_outlined),
|
|
|
|
reason,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
icon: '🗑️',
|
|
|
|
textColor: buttonTextColor,
|
|
|
|
textColor: buttonTextColor,
|
|
|
|
onPressed: () => onInfoTab!(event),
|
|
|
|
onPressed: () => onInfoTab!(event),
|
|
|
|
fontSize: fontSize,
|
|
|
|
fontSize: fontSize,
|
|
|
@ -263,7 +270,7 @@ class MessageContent extends StatelessWidget {
|
|
|
|
snapshot.data?.calcDisplayname() ??
|
|
|
|
snapshot.data?.calcDisplayname() ??
|
|
|
|
event.senderFromMemoryOrFallback.calcDisplayname(),
|
|
|
|
event.senderFromMemoryOrFallback.calcDisplayname(),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
icon: const Icon(Icons.phone_outlined),
|
|
|
|
icon: '📞',
|
|
|
|
textColor: buttonTextColor,
|
|
|
|
textColor: buttonTextColor,
|
|
|
|
onPressed: () => onInfoTab!(event),
|
|
|
|
onPressed: () => onInfoTab!(event),
|
|
|
|
fontSize: fontSize,
|
|
|
|
fontSize: fontSize,
|
|
|
@ -280,7 +287,7 @@ class MessageContent extends StatelessWidget {
|
|
|
|
event.senderFromMemoryOrFallback.calcDisplayname(),
|
|
|
|
event.senderFromMemoryOrFallback.calcDisplayname(),
|
|
|
|
event.type,
|
|
|
|
event.type,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
icon: const Icon(Icons.info_outlined),
|
|
|
|
icon: 'ℹ️',
|
|
|
|
textColor: buttonTextColor,
|
|
|
|
textColor: buttonTextColor,
|
|
|
|
onPressed: () => onInfoTab!(event),
|
|
|
|
onPressed: () => onInfoTab!(event),
|
|
|
|
fontSize: fontSize,
|
|
|
|
fontSize: fontSize,
|
|
|
@ -294,7 +301,7 @@ class MessageContent extends StatelessWidget {
|
|
|
|
class _ButtonContent extends StatelessWidget {
|
|
|
|
class _ButtonContent extends StatelessWidget {
|
|
|
|
final void Function() onPressed;
|
|
|
|
final void Function() onPressed;
|
|
|
|
final String label;
|
|
|
|
final String label;
|
|
|
|
final Icon icon;
|
|
|
|
final String icon;
|
|
|
|
final Color? textColor;
|
|
|
|
final Color? textColor;
|
|
|
|
final double fontSize;
|
|
|
|
final double fontSize;
|
|
|
|
|
|
|
|
|
|
|
@ -311,20 +318,12 @@ class _ButtonContent extends StatelessWidget {
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return InkWell(
|
|
|
|
return InkWell(
|
|
|
|
onTap: onPressed,
|
|
|
|
onTap: onPressed,
|
|
|
|
child: Row(
|
|
|
|
child: Text(
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
'$icon $label',
|
|
|
|
children: [
|
|
|
|
style: TextStyle(
|
|
|
|
icon,
|
|
|
|
color: textColor,
|
|
|
|
const SizedBox(width: 8),
|
|
|
|
fontSize: fontSize,
|
|
|
|
Text(
|
|
|
|
),
|
|
|
|
label,
|
|
|
|
|
|
|
|
overflow: TextOverflow.ellipsis,
|
|
|
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
|
|
|
color: textColor,
|
|
|
|
|
|
|
|
fontSize: fontSize,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|