Fixed Mention prefix detection

This commit is contained in:
RogueException
2016-07-20 22:13:58 -03:00
parent f923a7f0b3
commit c191f65c63

View File

@@ -29,10 +29,16 @@
int endPos = text.IndexOf('>');
if (endPos == -1) return false;
if (text.Length < endPos + 2 || text[endPos + 1] != ' ') return false; //Must end in "> "
ulong userId;
if (!MentionUtils.TryParseUser(text.Substring(0, endPos), out userId)) return false;
return userId == user.Id;
if (!MentionUtils.TryParseUser(text.Substring(0, endPos + 2), out userId)) return false;
if (userId == user.Id)
{
argPos = endPos + 2;
return true;
}
return false;
}
}
}