Skip to content

Commit

Permalink
edge case for read receipts (#201)
Browse files Browse the repository at this point in the history
Co-authored-by: Donovon Simpson <[email protected]>
  • Loading branch information
dltacube and trek-boldly-go authored Mar 12, 2024
1 parent 4f57efb commit 26a3dec
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion imessage/bluebubbles/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,22 @@ func (bb *blueBubbles) handleNewMessage(rawMessage json.RawMessage) (err error)
default:
bb.log.Warn().Msg("Incoming message buffer is full")
}

if !message.ReadAt.IsZero() && data.DateRetracted == 0 && data.DateEdited == 0 {
senderGUID := data.Chats[0].GUID
var receipt = imessage.ReadReceipt{
SenderGUID: senderGUID,
IsFromMe: false,
ChatGUID: message.ChatGUID,
ReadUpTo: message.GUID,
ReadAt: message.ReadAt,
JSONUnixReadAt: message.JSONUnixReadAt,
}
select {
case bb.receiptChan <- &receipt:
default:
bb.log.Warn().Msg("Incoming message buffer is full")
}
}
return nil
}

Expand Down

0 comments on commit 26a3dec

Please sign in to comment.