mirror of
https://github.com/tgstation/tgstation-server.git
synced 2026-08-30 16:39:21 +01:00
Minor chat improvements
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user