mirror of
https://github.com/ppy/osu.git
synced 2024-12-15 06:43:21 +08:00
Fixes not matching coding style
This commit is contained in:
parent
39594b7362
commit
f02e44d552
@ -7,7 +7,7 @@ using osu.Game.Online.Chat;
|
||||
namespace osu.Game.Tests.Online.Chat
|
||||
{
|
||||
[TestFixture]
|
||||
public class TestCheckUsername
|
||||
public class MessageNotifierTest
|
||||
{
|
||||
[Test]
|
||||
public void TestContainsUsernameMidlinePositive()
|
||||
|
@ -130,7 +130,8 @@ namespace osu.Game.Online.Chat
|
||||
/// Checks if <paramref name="message"/> mentions <paramref name="username"/>.
|
||||
/// This will match against the case where underscores are used instead of spaces (which is how osu-stable handles usernames with spaces).
|
||||
/// </summary>
|
||||
public static bool checkContainsUsername(string message, string username) {
|
||||
public static bool checkContainsUsername(string message, string username)
|
||||
{
|
||||
string fullName = Regex.Escape(username);
|
||||
string underscoreName = Regex.Escape(username.Replace(' ', '_'));
|
||||
return new Regex($"\\b({fullName}|{underscoreName})\\b", RegexOptions.IgnoreCase).Matches(message).Count > 0;
|
||||
|
Loading…
Reference in New Issue
Block a user