From 2534837b3a876c4df952ac4b20964c797b1e2c95 Mon Sep 17 00:00:00 2001 From: Jordan Brown Date: Tue, 28 Apr 2020 10:00:30 -0400 Subject: [PATCH] Minor chat improvements --- .../Components/Chat/ChannelMapping.cs | 4 ++-- src/Tgstation.Server.Host/Components/Chat/ChatManager.cs | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/Tgstation.Server.Host/Components/Chat/ChannelMapping.cs b/src/Tgstation.Server.Host/Components/Chat/ChannelMapping.cs index 380368eff2..6dc3c84b9c 100644 --- a/src/Tgstation.Server.Host/Components/Chat/ChannelMapping.cs +++ b/src/Tgstation.Server.Host/Components/Chat/ChannelMapping.cs @@ -11,7 +11,7 @@ public long ProviderId { get; set; } /// - /// The original + /// The original . /// public ulong ProviderChannelId { get; set; } @@ -26,7 +26,7 @@ public bool IsUpdatesChannel { get; set; } /// - /// The with the mapped Id + /// The with the mapped Id. /// public ChannelRepresentation Channel { get; set; } } diff --git a/src/Tgstation.Server.Host/Components/Chat/ChatManager.cs b/src/Tgstation.Server.Host/Components/Chat/ChatManager.cs index a85ed9c6db..0cd2ee4bb5 100644 --- a/src/Tgstation.Server.Host/Components/Chat/ChatManager.cs +++ b/src/Tgstation.Server.Host/Components/Chat/ChatManager.cs @@ -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;