diff --git a/osu.Game/Online/Chat/InfoMessage.cs b/osu.Game/Online/Chat/InfoMessage.cs index 2be025e403..2ff901deb1 100644 --- a/osu.Game/Online/Chat/InfoMessage.cs +++ b/osu.Game/Online/Chat/InfoMessage.cs @@ -6,7 +6,7 @@ namespace osu.Game.Online.Chat { - public class InfoMessage : Message + public class InfoMessage : LocalMessage { private static int infoID = -1; diff --git a/osu.Game/Online/Chat/LocalEchoMessage.cs b/osu.Game/Online/Chat/LocalEchoMessage.cs index 2e90b9d3fd..7d678029aa 100644 --- a/osu.Game/Online/Chat/LocalEchoMessage.cs +++ b/osu.Game/Online/Chat/LocalEchoMessage.cs @@ -3,7 +3,7 @@ namespace osu.Game.Online.Chat { - public class LocalEchoMessage : Message + public class LocalEchoMessage : LocalMessage { public LocalEchoMessage() : base(null) { diff --git a/osu.Game/Online/Chat/LocalMessage.cs b/osu.Game/Online/Chat/LocalMessage.cs new file mode 100644 index 0000000000..93f1e7f9ea --- /dev/null +++ b/osu.Game/Online/Chat/LocalMessage.cs @@ -0,0 +1,16 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +namespace osu.Game.Online.Chat +{ + /// + /// A message which is generated and displayed locally. + /// + public class LocalMessage : Message + { + protected LocalMessage(long? id) + : base(id) + { + } + } +} diff --git a/osu.Game/Overlays/Chat/DrawableChannel.cs b/osu.Game/Overlays/Chat/DrawableChannel.cs index bcc8879902..c57e71b5ad 100644 --- a/osu.Game/Overlays/Chat/DrawableChannel.cs +++ b/osu.Game/Overlays/Chat/DrawableChannel.cs @@ -85,7 +85,7 @@ private void newMessagesArrived(IEnumerable newMessages) if (!IsLoaded) return; - if (scroll.IsScrolledToEnd(10) || !flow.Children.Any()) + if (scroll.IsScrolledToEnd(10) || !flow.Children.Any() || newMessages.Any(m => m is LocalMessage)) scrollToEnd(); var staleMessages = flow.Children.Where(c => c.LifetimeEnd == double.MaxValue).ToArray();