From ff44bbf7f9d68ec3606ad636f08097d65cd43708 Mon Sep 17 00:00:00 2001 From: shilangyu Date: Sat, 4 Sep 2021 15:18:38 +0200 Subject: [PATCH] Add modlog entries for community transfers --- lib/pages/modlog_page.dart | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/lib/pages/modlog_page.dart b/lib/pages/modlog_page.dart index 11f2cc9..d4dcd28 100644 --- a/lib/pages/modlog_page.dart +++ b/lib/pages/modlog_page.dart @@ -343,6 +343,25 @@ class _ModlogTable extends StatelessWidget { ), ), ), + for (final transferredToCommunity in modlog.transferredToCommunity) + _ModlogEntry.fromModTransferCommunityView( + transferredToCommunity, + RichText( + text: TextSpan( + children: [ + if (transferredToCommunity.modTransferCommunity.removed ?? + false) + const TextSpan(text: 'removed ') + else + const TextSpan(text: 'transferred '), + community(transferredToCommunity.community), + const TextSpan(text: ' to '), + user(transferredToCommunity.moddedPerson), + ], + style: TextStyle(color: theme.colorScheme.onSurface), + ), + ), + ), for (final added in modlog.added) _ModlogEntry.fromModAddView( added, @@ -482,6 +501,15 @@ class _ModlogEntry { action: action, ); + _ModlogEntry.fromModTransferCommunityView( + ModTransferCommunityView transferCommunity, + Widget action, + ) : this( + when: transferCommunity.modTransferCommunity.when, + mod: transferCommunity.moderator, + action: action, + ); + _ModlogEntry.fromModAddView( ModAddView added, Widget action,