For uploads, use verbatim URL string from server #1777
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #1709.
Commit messages
314c83c api [nfc]: Rename field UploadFileResult.url from "uri"
Like elsewhere in our codebase, use the standard term "URL":
https://github.com/zulip/zulip-mobile/blob/main/docs/style.md#url-not-uri
c7f336c compose [nfc]: Take a URL string at inlineLink, rather than a Uri object
This way this function is a more faithful wrapper of constructing
the actual Markdown syntax. The Markdown will have a URL string,
after all, so it's for the best to put this function's caller in
control of exactly what string that is.
2e06a67 compose: For uploads, use verbatim URL string from server
Fixes #1709.
Round-tripping through
Uri.parseand.toString()had the effectof percent-encoding any non-ASCII characters in the given URL string.
The server expects, reasonably enough, that the client will refer to
the upload using the same URL string the server provided at upload
time; so do that.
6a35cc4 compose [nfc]: Simplify inlineLink by dropping null destination
Now that the caller is passing a string instead of a Uri object, the
caller that wants an empty string here can just pass an empty string.