mirror of
https://github.com/osukey/osukey.git
synced 2025-05-11 08:37:34 +09: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
|
namespace osu.Game.Tests.Online.Chat
|
||||||
{
|
{
|
||||||
[TestFixture]
|
[TestFixture]
|
||||||
public class TestCheckUsername
|
public class MessageNotifierTest
|
||||||
{
|
{
|
||||||
[Test]
|
[Test]
|
||||||
public void TestContainsUsernameMidlinePositive()
|
public void TestContainsUsernameMidlinePositive()
|
||||||
|
@ -130,7 +130,8 @@ namespace osu.Game.Online.Chat
|
|||||||
/// Checks if <paramref name="message"/> mentions <paramref name="username"/>.
|
/// 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).
|
/// This will match against the case where underscores are used instead of spaces (which is how osu-stable handles usernames with spaces).
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static bool checkContainsUsername(string message, string username) {
|
public static bool checkContainsUsername(string message, string username)
|
||||||
|
{
|
||||||
string fullName = Regex.Escape(username);
|
string fullName = Regex.Escape(username);
|
||||||
string underscoreName = Regex.Escape(username.Replace(' ', '_'));
|
string underscoreName = Regex.Escape(username.Replace(' ', '_'));
|
||||||
return new Regex($"\\b({fullName}|{underscoreName})\\b", RegexOptions.IgnoreCase).Matches(message).Count > 0;
|
return new Regex($"\\b({fullName}|{underscoreName})\\b", RegexOptions.IgnoreCase).Matches(message).Count > 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user