Properly sort proxies before matching

This commit is contained in:
Ske 2019-10-30 08:30:58 +01:00
parent 393ee16c1b
commit b50c123ad4

View File

@ -58,7 +58,7 @@ namespace PluralKit.Bot
}
// Flatten and sort by specificity (ProxyString length desc = prefix+suffix length desc = inner message asc = more specific proxy first!)
var ordered = potentialMembers.SelectMany(m => m.Member.ProxyTags.Select(tag => (tag, m))).OrderByDescending(p => p.Item1.ProxyString);
var ordered = potentialMembers.SelectMany(m => m.Member.ProxyTags.Select(tag => (tag, m))).OrderByDescending(p => p.Item1.ProxyString.Length);
foreach (var (tag, match) in ordered)
{
if (tag.Prefix == null && tag.Suffix == null) continue;