mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2024-12-17 17:20:21 +01:00
core: differentiate inactive and forwarded group snd statuses (#4420)
* core: GroupSndStatus * rfc * encoding, db apis * pending, forwarded statuses * encoding
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
# Group messages sending status
|
||||
|
||||
## Problem
|
||||
|
||||
Currently in UI chat item info:
|
||||
- There's no differentiation between sent messages and pending messages.
|
||||
- There's no differentiation between pending messages reasons (establishing connection or member inactivity).
|
||||
- Since the former is usually not a case due to group forwarding, this can be ignored.
|
||||
- Messages to be forwarded by admin are not accounted.
|
||||
|
||||
## Solution
|
||||
|
||||
Differentiate new statuses for group sending in chat item info:
|
||||
- forwarded
|
||||
- inactive / pending
|
||||
|
||||
Option 1 is to add statuses to CIStatus / ACIStatus types.
|
||||
|
||||
Pros:
|
||||
- simple.
|
||||
|
||||
Cons:
|
||||
- further muddies type of statuses for chat item with impossible states / different dimension, as it's not applicable directly to chat item but a technicality of group sending process.
|
||||
|
||||
Option 2 is to create a new type, GroupSndStatus.
|
||||
|
||||
```haskell
|
||||
data GroupSndStatus
|
||||
= GSSNew
|
||||
| GSSForwarded
|
||||
| GSSInactive
|
||||
| GSSSent
|
||||
| GSSRcvd {msgRcptStatus :: MsgReceiptStatus}
|
||||
| GSSError {agentError :: SndError}
|
||||
| GSSWarning {agentError :: SndError}
|
||||
| GSSInvalid {text :: Text}
|
||||
```
|
||||
|
||||
Most statuses repeat CIStatus sending statuses, with addition of forwarded and inactive for group sending process.
|
||||
|
||||
Pros:
|
||||
- separates concerns of chat item presentation from group sending process.
|
||||
- allows future extension without further muddying CIStatus types.
|
||||
|
||||
Cons:
|
||||
- more work.
|
||||
- requires backwards compatible decoding with ACIStatus to read previous data from db.
|
||||
Reference in New Issue
Block a user