Ensure all LocalMessages get a timestamp

This commit is contained in:
Dean Herbert 2022-11-30 15:46:36 +09:00
parent c84f011bb7
commit 9e34fe360a
4 changed files with 4 additions and 7 deletions

View File

@ -104,6 +104,7 @@ namespace osu.Game.Tests.Visual.Online
{ {
var standardMessage = new Message(messageIdSequence++) var standardMessage = new Message(messageIdSequence++)
{ {
Timestamp = DateTimeOffset.Now,
Sender = admin, Sender = admin,
Content = "I am a wang!" Content = "I am a wang!"
}; };
@ -113,6 +114,7 @@ namespace osu.Game.Tests.Visual.Online
var standardMessage2 = new Message(messageIdSequence++) var standardMessage2 = new Message(messageIdSequence++)
{ {
Timestamp = DateTimeOffset.Now,
Sender = admin, Sender = admin,
Content = "I am a wang!" Content = "I am a wang!"
}; };

View File

@ -1,9 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text. // See the LICENCE file in the repository root for full licence text.
#nullable disable
using System;
using osu.Game.Online.API.Requests.Responses; using osu.Game.Online.API.Requests.Responses;
namespace osu.Game.Online.Chat namespace osu.Game.Online.Chat
@ -13,7 +10,6 @@ namespace osu.Game.Online.Chat
public InfoMessage(string message) public InfoMessage(string message)
: base(null) : base(null)
{ {
Timestamp = DateTimeOffset.Now;
Content = message; Content = message;
Sender = APIUser.SYSTEM_USER; Sender = APIUser.SYSTEM_USER;

View File

@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text. // See the LICENCE file in the repository root for full licence text.
#nullable disable
namespace osu.Game.Online.Chat namespace osu.Game.Online.Chat
{ {
public class LocalEchoMessage : LocalMessage public class LocalEchoMessage : LocalMessage

View File

@ -1,7 +1,7 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text. // See the LICENCE file in the repository root for full licence text.
#nullable disable using System;
namespace osu.Game.Online.Chat namespace osu.Game.Online.Chat
{ {
@ -13,6 +13,7 @@ namespace osu.Game.Online.Chat
protected LocalMessage(long? id) protected LocalMessage(long? id)
: base(id) : base(id)
{ {
Timestamp = DateTimeOffset.Now;
} }
} }
} }