|
|
@ -17,7 +17,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
var userColor = Model.ExportContext.TryGetUserColor(Model.MessageGroup.Author.Id);
|
|
|
|
var userColor = Model.ExportContext.TryGetUserColor(Model.MessageGroup.Author.Id);
|
|
|
|
|
|
|
|
|
|
|
|
var userColorStyle = userColor != null
|
|
|
|
var userColorStyle = userColor is not null
|
|
|
|
? $"color: rgb({userColor?.R},{userColor?.G},{userColor?.B})"
|
|
|
|
? $"color: rgb({userColor?.R},{userColor?.G},{userColor?.B})"
|
|
|
|
: null;
|
|
|
|
: null;
|
|
|
|
|
|
|
|
|
|
|
@ -25,19 +25,19 @@
|
|
|
|
? Model.MessageGroup.Author.Name
|
|
|
|
? Model.MessageGroup.Author.Name
|
|
|
|
: userMember?.Nick ?? Model.MessageGroup.Author.Name;
|
|
|
|
: userMember?.Nick ?? Model.MessageGroup.Author.Name;
|
|
|
|
|
|
|
|
|
|
|
|
var referencedUserMember = Model.MessageGroup.ReferencedMessage != null
|
|
|
|
var referencedUserMember = Model.MessageGroup.ReferencedMessage is not null
|
|
|
|
? Model.ExportContext.TryGetMember(Model.MessageGroup.ReferencedMessage.Author.Id)
|
|
|
|
? Model.ExportContext.TryGetMember(Model.MessageGroup.ReferencedMessage.Author.Id)
|
|
|
|
: null;
|
|
|
|
: null;
|
|
|
|
|
|
|
|
|
|
|
|
var referencedUserColor = Model.MessageGroup.ReferencedMessage != null
|
|
|
|
var referencedUserColor = Model.MessageGroup.ReferencedMessage is not null
|
|
|
|
? Model.ExportContext.TryGetUserColor(Model.MessageGroup.ReferencedMessage.Author.Id)
|
|
|
|
? Model.ExportContext.TryGetUserColor(Model.MessageGroup.ReferencedMessage.Author.Id)
|
|
|
|
: null;
|
|
|
|
: null;
|
|
|
|
|
|
|
|
|
|
|
|
var referencedUserColorStyle = referencedUserColor != null
|
|
|
|
var referencedUserColorStyle = referencedUserColor is not null
|
|
|
|
? $"color: rgb({referencedUserColor?.R},{referencedUserColor?.G},{referencedUserColor?.B})"
|
|
|
|
? $"color: rgb({referencedUserColor?.R},{referencedUserColor?.G},{referencedUserColor?.B})"
|
|
|
|
: null;
|
|
|
|
: null;
|
|
|
|
|
|
|
|
|
|
|
|
var referencedUserNick = Model.MessageGroup.ReferencedMessage != null
|
|
|
|
var referencedUserNick = Model.MessageGroup.ReferencedMessage is not null
|
|
|
|
? Model.MessageGroup.ReferencedMessage.Author.IsBot
|
|
|
|
? Model.MessageGroup.ReferencedMessage.Author.IsBot
|
|
|
|
? Model.MessageGroup.ReferencedMessage.Author.Name
|
|
|
|
? Model.MessageGroup.ReferencedMessage.Author.Name
|
|
|
|
: referencedUserMember?.Nick ?? Model.MessageGroup.ReferencedMessage.Author.Name
|
|
|
|
: referencedUserMember?.Nick ?? Model.MessageGroup.ReferencedMessage.Author.Name
|
|
|
@ -45,12 +45,12 @@
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
<div class="chatlog__message-group">
|
|
|
|
<div class="chatlog__message-group">
|
|
|
|
@if (Model.MessageGroup.Reference != null)
|
|
|
|
@if (Model.MessageGroup.Reference is not null)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
<div class="chatlog__reference-symbol">
|
|
|
|
<div class="chatlog__reference-symbol">
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="chatlog__reference">
|
|
|
|
<div class="chatlog__reference">
|
|
|
|
@if (Model.MessageGroup.ReferencedMessage != null)
|
|
|
|
@if (Model.MessageGroup.ReferencedMessage is not null)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
<img class="chatlog__reference-avatar" src="@await ResolveUrlAsync(Model.MessageGroup.ReferencedMessage.Author.AvatarUrl)" alt="Avatar">
|
|
|
|
<img class="chatlog__reference-avatar" src="@await ResolveUrlAsync(Model.MessageGroup.ReferencedMessage.Author.AvatarUrl)" alt="Avatar">
|
|
|
|
<span class="chatlog__reference-name" title="@Model.MessageGroup.ReferencedMessage.Author.FullName" style="@referencedUserColorStyle">@referencedUserNick</span>
|
|
|
|
<span class="chatlog__reference-name" title="@Model.MessageGroup.ReferencedMessage.Author.FullName" style="@referencedUserColorStyle">@referencedUserNick</span>
|
|
|
@ -66,7 +66,7 @@
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</span>
|
|
|
|
</span>
|
|
|
|
|
|
|
|
|
|
|
|
@if (Model.MessageGroup.ReferencedMessage.EditedTimestamp != null)
|
|
|
|
@if (Model.MessageGroup.ReferencedMessage.EditedTimestamp is not null)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
<span class="chatlog__reference-edited-timestamp" title="@FormatDate(Model.MessageGroup.ReferencedMessage.EditedTimestamp.Value)">(edited)</span>
|
|
|
|
<span class="chatlog__reference-edited-timestamp" title="@FormatDate(Model.MessageGroup.ReferencedMessage.EditedTimestamp.Value)">(edited)</span>
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -98,13 +98,13 @@
|
|
|
|
var isPinnedStyle = message.IsPinned ? "chatlog__message--pinned" : null;
|
|
|
|
var isPinnedStyle = message.IsPinned ? "chatlog__message--pinned" : null;
|
|
|
|
|
|
|
|
|
|
|
|
<div class="chatlog__message @isPinnedStyle" data-message-id="@message.Id" id="message-@message.Id">
|
|
|
|
<div class="chatlog__message @isPinnedStyle" data-message-id="@message.Id" id="message-@message.Id">
|
|
|
|
@if (!string.IsNullOrWhiteSpace(message.Content) || message.EditedTimestamp != null)
|
|
|
|
@if (!string.IsNullOrWhiteSpace(message.Content) || message.EditedTimestamp is not null)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
<div class="chatlog__content">
|
|
|
|
<div class="chatlog__content">
|
|
|
|
<div class="markdown">
|
|
|
|
<div class="markdown">
|
|
|
|
<span class="preserve-whitespace">@Raw(FormatMarkdown(message.Content))</span>
|
|
|
|
<span class="preserve-whitespace">@Raw(FormatMarkdown(message.Content))</span>
|
|
|
|
|
|
|
|
|
|
|
|
@if (message.EditedTimestamp != null)
|
|
|
|
@if (message.EditedTimestamp is not null)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
<span class="chatlog__edited-timestamp" title="@FormatDate(message.EditedTimestamp.Value)">(edited)</span>
|
|
|
|
<span class="chatlog__edited-timestamp" title="@FormatDate(message.EditedTimestamp.Value)">(edited)</span>
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -162,7 +162,7 @@
|
|
|
|
@foreach (var embed in message.Embeds)
|
|
|
|
@foreach (var embed in message.Embeds)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
<div class="chatlog__embed">
|
|
|
|
<div class="chatlog__embed">
|
|
|
|
@if (embed.Color != null)
|
|
|
|
@if (embed.Color is not null)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var embedColorStyle = $"background-color: rgba({embed.Color?.R},{embed.Color?.G},{embed.Color?.B},{embed.Color?.A})";
|
|
|
|
var embedColorStyle = $"background-color: rgba({embed.Color?.R},{embed.Color?.G},{embed.Color?.B},{embed.Color?.A})";
|
|
|
|
<div class="chatlog__embed-color-pill" style="@embedColorStyle"></div>
|
|
|
|
<div class="chatlog__embed-color-pill" style="@embedColorStyle"></div>
|
|
|
@ -175,7 +175,7 @@
|
|
|
|
<div class="chatlog__embed-content-container">
|
|
|
|
<div class="chatlog__embed-content-container">
|
|
|
|
<div class="chatlog__embed-content">
|
|
|
|
<div class="chatlog__embed-content">
|
|
|
|
<div class="chatlog__embed-text">
|
|
|
|
<div class="chatlog__embed-text">
|
|
|
|
@if (embed.Author != null)
|
|
|
|
@if (embed.Author is not null)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
<div class="chatlog__embed-author">
|
|
|
|
<div class="chatlog__embed-author">
|
|
|
|
@if (!string.IsNullOrWhiteSpace(embed.Author.IconUrl))
|
|
|
|
@if (!string.IsNullOrWhiteSpace(embed.Author.IconUrl))
|
|
|
@ -249,7 +249,7 @@
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
@if (embed.Thumbnail != null)
|
|
|
|
@if (embed.Thumbnail is not null)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
<div class="chatlog__embed-thumbnail-container">
|
|
|
|
<div class="chatlog__embed-thumbnail-container">
|
|
|
|
<a class="chatlog__embed-thumbnail-link" href="@await ResolveUrlAsync(embed.Thumbnail.Url)">
|
|
|
|
<a class="chatlog__embed-thumbnail-link" href="@await ResolveUrlAsync(embed.Thumbnail.Url)">
|
|
|
@ -259,7 +259,7 @@
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
@if (embed.Image != null)
|
|
|
|
@if (embed.Image is not null)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
<div class="chatlog__embed-image-container">
|
|
|
|
<div class="chatlog__embed-image-container">
|
|
|
|
<a class="chatlog__embed-image-link" href="@await ResolveUrlAsync(embed.Image.Url)">
|
|
|
|
<a class="chatlog__embed-image-link" href="@await ResolveUrlAsync(embed.Image.Url)">
|
|
|
@ -268,7 +268,7 @@
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@if (embed.Footer != null || embed.Timestamp != null)
|
|
|
|
@if (embed.Footer is not null || embed.Timestamp is not null)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
<div class="chatlog__embed-footer">
|
|
|
|
<div class="chatlog__embed-footer">
|
|
|
|
@if (!string.IsNullOrWhiteSpace(embed.Footer?.IconUrl))
|
|
|
|
@if (!string.IsNullOrWhiteSpace(embed.Footer?.IconUrl))
|
|
|
@ -282,12 +282,12 @@
|
|
|
|
@embed.Footer.Text
|
|
|
|
@embed.Footer.Text
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@if (!string.IsNullOrWhiteSpace(embed.Footer?.Text) && embed.Timestamp != null)
|
|
|
|
@if (!string.IsNullOrWhiteSpace(embed.Footer?.Text) && embed.Timestamp is not null)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
@(" • ")
|
|
|
|
@(" • ")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@if (embed.Timestamp != null)
|
|
|
|
@if (embed.Timestamp is not null)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
@FormatDate(embed.Timestamp.Value)
|
|
|
|
@FormatDate(embed.Timestamp.Value)
|
|
|
|
}
|
|
|
|
}
|
|
|
|