mirror of https://github.com/ppy/osu
Fixes not matching coding style
This commit is contained in:
parent
39594b7362
commit
f02e44d552
|
@ -7,7 +7,7 @@
|
|||
namespace osu.Game.Tests.Online.Chat
|
||||
{
|
||||
[TestFixture]
|
||||
public class TestCheckUsername
|
||||
public class MessageNotifierTest
|
||||
{
|
||||
[Test]
|
||||
public void TestContainsUsernameMidlinePositive()
|
||||
|
|
|
@ -130,7 +130,8 @@ private void checkForMentions(Channel channel, Message message)
|
|||
/// 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