Normalize spaces before system notifications

pull/1001/head
Tyrrrz 2 years ago
parent 3b2c308a25
commit f99f1f4641

@ -92,11 +92,14 @@
@{/* Author name */}
<span class="chatlog__system-notification-author" style="@(userColor is not null ? $"color: rgb({userColor.Value.R}, {userColor.Value.G}, {userColor.Value.B})" : null)" title="@message.Author.FullName" data-user-id="@message.Author.Id">@userNick</span>
@{/* Space out the content */}
<span> </span>
@{/* System notification content */}
<span class="chatlog__system-notification-content">
@if (message.Kind == MessageKind.RecipientAdd && message.MentionedUsers.Any())
{
<span> added </span>
<span>added </span>
<a class="chatlog__system-notification-link" title="@message.MentionedUsers.First().FullName">@message.MentionedUsers.First().Name</a>
<span> to the group.</span>
}
@ -104,45 +107,44 @@
{
if (message.Author.Id == message.MentionedUsers.First().Id)
{
<span> left the group.</span>
<span>left the group.</span>
}
else
{
<span> removed </span>
<span>removed </span>
<a class="chatlog__system-notification-link" title="@message.MentionedUsers.First().FullName">@message.MentionedUsers.First().Name</a>
<span> from the group.</span>
}
}
else if (message.Kind == MessageKind.Call)
{
<span> started a call that lasted @(((message.CallEndedTimestamp ?? message.Timestamp) - message.Timestamp).TotalMinutes) minutes</span>
<span>started a call that lasted @(((message.CallEndedTimestamp ?? message.Timestamp) - message.Timestamp).TotalMinutes) minutes</span>
}
else if (message.Kind == MessageKind.ChannelNameChange)
{
<span> changed the channel name: </span>
<span>changed the channel name: </span>
<span class="chatlog__system-notification-link">@message.Content</span>
}
else if (message.Kind == MessageKind.ChannelIconChange)
{
<span> changed the channel icon.</span>
<span>changed the channel icon.</span>
}
else if (message.Kind == MessageKind.ChannelPinnedMessage && message.Reference is not null)
{
<span> pinned</span>
<span>pinned</span>
<a class="chatlog__system-notification-link" href="#chatlog__message-container-@message.Reference.MessageId"> a message</a>
<span> to this channel.</span>
}
else if (message.Kind == MessageKind.ThreadCreated)
{
<span> started a thread.</span>
<span>started a thread.</span>
}
else if (message.Kind == MessageKind.GuildMemberJoin)
{
<span> joined the server.</span>
<span>joined the server.</span>
}
else
{
<span> </span>
<span>@message.Content.ToLowerInvariant()</span>
}
</span>

Loading…
Cancel
Save