stakwork / sphinx-mac-v2

MIT License
0 stars 0 forks source link

Fix read logic for empty conversations #17

Closed tomastiminskas closed 4 months ago

tomastiminskas commented 4 months ago

Empty conversations with new contacts will have no visible/stored messages in device db so when entering the chat app won't be able to call the setRead binding to set the highest read index in the LSP.

In the other hand the LSP will have a message of type 33 (which is not stored in the device during restore) and that will be considered in the badge count sent in each push notification

Possible fix: store indexes of msgs of type 33 during restore and on restore finished iterate them and call the setRead binding for each conversation with no messages using that index