Merge pull request #150
* Hash message links so messages with different links aren't considered… * Add option to toggle if links should be considered for the message ha…
This commit is contained in:
+13
-4
@@ -137,10 +137,19 @@ internal partial class Message
|
||||
|
||||
private int GenerateHash()
|
||||
{
|
||||
return SortCode.GetHashCode()
|
||||
^ ExtraChatChannel.GetHashCode()
|
||||
^ string.Join("", Sender.Select(c => c.StringValue())).GetHashCode()
|
||||
^ string.Join("", Content.Select(c => c.StringValue())).GetHashCode();
|
||||
var hash = SortCode.GetHashCode()
|
||||
^ ExtraChatChannel.GetHashCode()
|
||||
^ string.Join("", Sender.Select(c => c.StringValue())).GetHashCode()
|
||||
^ string.Join("", Content.Select(c => c.StringValue())).GetHashCode();
|
||||
|
||||
if (Plugin.Config.CollapseKeepUniqueLinks)
|
||||
{
|
||||
// Hash the link too for something like DeathRecap where the message is the same
|
||||
// but the link is different
|
||||
hash ^= string.Join("", Content.Select(c => c.Link?.GetHashCode())).GetHashCode();
|
||||
}
|
||||
|
||||
return hash;
|
||||
}
|
||||
|
||||
private static Guid ExtractExtraChatChannel(SeString contentSource)
|
||||
|
||||
Reference in New Issue
Block a user