Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for XEP-0363 (HTTP Upload) version 0.3.0. #1185

Merged
merged 2 commits into from
Feb 17, 2017
Merged

Conversation

kzemek
Copy link
Contributor

@kzemek kzemek commented Feb 13, 2017

This PR adds support for XEP-0363 v 0.3.0 while preserving backwards compatibility with version 0.2.5 (which looks to have conforming client implementations).

Copy link
Contributor

@michalwski michalwski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR looks really good. I have only one minor comment.


case is_binary(Filename) andalso <<>> =/= Filename
andalso is_integer(Size) andalso Size >= 0 of
case is_binary(Filename) andalso <<>> =/= Filename andalso is_integer(Size) andalso Size >= 0 of
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This conditional consists of 4 parts. I think it would more readable and easier to understand if

is_binary(Filename) andalso <<>> =/= Filename andalso is_integer(Size) andalso Size >= 0

where encapsulated in a function with some meaningful name, f.e is_filename_and_size_acceptable.

@fenek fenek merged commit 22bcceb into master Feb 17, 2017
@fenek fenek deleted the http_upload_0_3 branch February 17, 2017 07:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants