forked from zulip/zulip-flutter
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
send [nfc]: Always pass readBySender true
I think we're always going to want this parameter to be true for all the messages we send from the app. In the API bindings themselves, i.e. in lib/api/ , I generally prefer not to hard-code this sort of thing. That lets the API bindings be a faithful reflection of the Zulip Server API, with a minimum of ad-hoc specializations for the needs of our app. So that's why the `sendMessage` binding just takes the parameter from its caller. But this method PerAccountStore.sendMessage is already something specific to our app rather than an API binding; it doesn't do much now beyond wrap the API, but the reason it exists is to be the future home of our "outbox" logic. That means (a) recording the message locally so that we can display it immediately, (b) possibly retrying the send, and (c) if the send fails or times out, recording that fact so that our UI can present the user with that information and the option to retry. So that makes it a natural home for encapsulating any other logic that this app will always want when sending a message. In particular, passing this parameter.
- Loading branch information
Showing
3 changed files
with
26 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters