From 52413907f733ef7df1f597a461c1bedb9956563c Mon Sep 17 00:00:00 2001 From: xeals Date: Thu, 26 Apr 2018 21:42:47 +1000 Subject: [PATCH] Mask the top 3 bits of the message type Only the lowest 5 bits are actually used to describe the message. Fixes #7. --- types/sms.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/sms.go b/types/sms.go index 323ab2e..3a1b188 100644 --- a/types/sms.go +++ b/types/sms.go @@ -166,9 +166,9 @@ func intToTime(n *uint64) *string { } func translateSMSType(t uint64) SMSType { - // Just get the lower 8 bits, because everything else is masking. + // Just get the lowest 5 bits, because everything else is masking. // https://github.com/signalapp/Signal-Android/blob/master/src/org/thoughtcrime/securesms/database/MmsSmsColumns.java - v := uint8(t) + v := uint8(t) & 0x1F switch v { // STANDARD