Add modlog entries for community transfers

This commit is contained in:
shilangyu 2021-09-04 15:18:38 +02:00
parent 0d2d9145ad
commit ff44bbf7f9
1 changed files with 28 additions and 0 deletions

View File

@ -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,