mirror of
https://github.com/chatmail/core.git
synced 2026-04-17 21:46:35 +03:00
webxdc: synchronous state for read-only-chats
already before, we did _not_ sent updates to contact requests or other read-only-chats. however, we _did_ modify the local database, so that getAllUpdates() returns an update that was not sent out to other peers. this is fixed by checking can_send() soon. that way, all peers have the same state also for contact requests or other read-only-chats and webxdc in contact requests can be opened as usual. further ui improvements may be needed for contact requests (maybe allow the webxdc to know about that state or maybe show a warning in the ui somewhere), however, this is not part of this pr.
This commit is contained in:
@@ -44,6 +44,13 @@ To get a shared state, the peers use `sendUpdate()` to send updates to each othe
|
||||
All peers, including the sending one,
|
||||
will receive the update by the callback given to `setUpdateListener()`.
|
||||
|
||||
There are situations where the user cannot send messages to a chat,
|
||||
eg. contact requests or if the user has left a group.
|
||||
In these cases, you can still call `sendUpdate()`,
|
||||
however, the update won't be sent to other peers
|
||||
and you won't get the update by `setUpdateListener()` nor by `getAllUpdates()`.
|
||||
|
||||
|
||||
### setUpdateListener()
|
||||
|
||||
```js
|
||||
|
||||
Reference in New Issue
Block a user