Minor chat improvements

This commit is contained in:
Jordan Brown
2020-04-28 10:00:30 -04:00
parent dcc55170b6
commit 2534837b3a
2 changed files with 10 additions and 2 deletions
@@ -11,7 +11,7 @@
public long ProviderId { get; set; }
/// <summary>
/// The original <see cref="Components.Chat.ChannelRepresentation.RealId"/>
/// The original <see cref="ChannelRepresentation.RealId"/>.
/// </summary>
public ulong ProviderChannelId { get; set; }
@@ -26,7 +26,7 @@
public bool IsUpdatesChannel { get; set; }
/// <summary>
/// The <see cref="Components.Chat.ChannelRepresentation"/> with the mapped Id
/// The <see cref="ChannelRepresentation"/> with the mapped Id.
/// </summary>
public ChannelRepresentation Channel { get; set; }
}
@@ -239,6 +239,11 @@ namespace Tgstation.Server.Host.Components.Chat
ulong newId;
lock (this)
newId = channelIdCounter++;
logger.LogTrace(
"Mapping private channel {0}:{1} as {2}",
message.User.Channel.ConnectionName,
message.User.FriendlyName,
newId);
mappedChannels.Add(newId, new ChannelMapping
{
IsWatchdogChannel = false,
@@ -468,6 +473,7 @@ namespace Tgstation.Server.Host.Components.Chat
foreach (var I in mappings)
{
var newId = baseId++;
logger.LogTrace("Mapping channel {0}:{1} as {2}", I.Channel.ConnectionName, I.Channel.FriendlyName, newId);
mappedChannels.Add(newId, I);
I.Channel.RealId = newId;
}
@@ -573,6 +579,8 @@ namespace Tgstation.Server.Host.Components.Chat
if (channelIds == null)
throw new ArgumentNullException(nameof(channelIds));
logger.LogTrace("Chat send \"{0}\" to channels: {1}", message, String.Join(", ", channelIds));
return Task.WhenAll(channelIds.Select(x =>
{
ChannelMapping channelMapping;