feat: word-based message filtering with quarantine approach (stored but hidden) (#4241)

This commit is contained in:
Mac DeCourcy 2026-01-24 08:41:17 -08:00 committed by GitHub
parent ae65e64a37
commit c0f8ed3503
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
32 changed files with 2187 additions and 115 deletions

View file

@ -58,10 +58,12 @@ class DataPacketTest {
fun `DataPacket equals and hashCode include sfppHash`() {
val hash1 = byteArrayOf(1, 2, 3)
val hash2 = byteArrayOf(4, 5, 6)
val p1 = DataPacket(to = "to", channel = 0, text = "text").copy(sfppHash = hash1)
val p2 = DataPacket(to = "to", channel = 0, text = "text").copy(sfppHash = hash1)
val p3 = DataPacket(to = "to", channel = 0, text = "text").copy(sfppHash = hash2)
val p4 = DataPacket(to = "to", channel = 0, text = "text").copy(sfppHash = null)
val fixedTime = 1000L
val base = DataPacket(to = "to", channel = 0, text = "text").copy(time = fixedTime)
val p1 = base.copy(sfppHash = hash1)
val p2 = base.copy(sfppHash = hash1.copyOf()) // same content, different array instance
val p3 = base.copy(sfppHash = hash2)
val p4 = base.copy(sfppHash = null)
assertEquals(p1, p2)
assertEquals(p1.hashCode(), p2.hashCode())