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

Feature: File transfer in secure conversations #231

Closed

Conversation

vdveer
Copy link
Contributor

@vdveer vdveer commented Aug 24, 2015

  • Select file and attach to secure conversation
  • Share file / to application and attach to secure conversation
  • Receiving of file on other end (other instances, like current version smssecure, ignores the payload).

Opened a PR because I am not sure if you read posts on closed PR's to discuss the usefulness of such feature. It works pretty well as I believe, including the edgecases when users try to attach and then switch transport mode. Filename addition to de PDU was also a nice one to debug. Well, let me know.

@@ -970,6 +1022,7 @@ private Drafts getDraftsForCurrentState() {
for (Slide slide : attachmentManager.getSlideDeck().getSlides()) {
if (slide.hasAudio()) drafts.add(new Draft(Draft.AUDIO, slide.getUri().toString()));
else if (slide.hasVideo()) drafts.add(new Draft(Draft.VIDEO, slide.getUri().toString()));
else if (slide.hasFile()) drafts.add(new Draft(Draft.FILE, slide.getUri().toString()));
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This line of code can use some comment; because the order here is pretty important. hasImage() needs to be the last one, as it is also used to determine the fact if a thumbnail needs to be shown (hasImage is true on audio and file).

@BLeQuerrec
Copy link
Member

Looks great. You need to:

  • Rebase you branch on SMSSecure/master (at least on 3e821e1 if we add new commits later)
  • Do not include translations yet (they will be managed on Transifex once the PR is merged)
  • Fix coding style (2-spaces indentation, one space just after a if, etc.)
  • Squash your commits

I didn't test your branch (will do after a rebase), but if I read your code well, you use SMS to send files, right? If so, what's the relation to #226?

@vdveer
Copy link
Contributor Author

vdveer commented Aug 28, 2015

I have merged master of my upstream origin (equals smssecure/master) into my branch but I will do that again if I missed any commits and squash the commits into one.
Wil remove translations and fix the spacing.

The file slides are transmitted through mms, not sms. There is no relation to #226 only that I reverted those commits on this branch (my master- and featurebranch allows setting the size), so when squashed there will be no relation at all.

I have some questions on the tests, how can I test my code in secure mode in the simulator? I used my (luckily unlimited) subscription to test this feature but it takes too much time to do so. As I am new to this project and Android development any tips or links to tips are appreciated.

Thanks for your feedback and managing this repo!

@vdveer
Copy link
Contributor Author

vdveer commented Aug 28, 2015

As I am working on multipart mms for filetransfer I would also like to open a discussion here on this matter. Is this something we want to include? Send a file of for example 3mb over a 280kb limited transport channel will potentially make it an expensive feature. On my local branch I only made it available if a preference is set to accept the feature and a notice is shown to the user that multiple (including the amount of) mms messages will be sent when attaching the oversized file to the message. For me this is a perfect feature, since I have unlimited EU MMS (and for example regular data on a internet apn I have to pay for while abroad in EU) , but I am not sure if this can be useful to the majority of users. What do you think?

Just the be sure; the multipart feature is not included in this pullrequest.

@BLeQuerrec
Copy link
Member

To test a build, just run ./gradlew connectedCheck (that's what we do in Travis CI). It will build, install and test SMSSecure on the connected device. Be sure to run it in the Android emulator (SMSSecure is uninstalled after passing tests).

Showing the number of MMSs is a good solution. As I said in #226, increasing MMS limit will brake compatibility on some networks.

@vdveer
Copy link
Contributor Author

vdveer commented Aug 28, 2015

About the mms size, that is indeed why I reverted these commits (mmssize is static again is this PR) and only leave them in my local branches. In this PR only files <280kB are attachable; others are discarded with a MediaTooLargeException (which lead to a toast telling the user the file is too large) like images when the residing and compressing fails to compress them below 280kB.
I haven't included multiparts in this PR since the user experience isn't great yet in my local branch, files are sent our as multiple parts but at the receiving end the still appear as multiple messages.it might take some time to fix this as I need to get more familiar with the partdatabase and messagedatabase before making it user-friendly.

@BLeQuerrec
Copy link
Member

OK. Can you rebase and squash your commits for now?

@BLeQuerrec BLeQuerrec self-assigned this Aug 28, 2015
@vdveer
Copy link
Contributor Author

vdveer commented Aug 29, 2015

I will but haven't found myself near a computer yet.

@vdveer
Copy link
Contributor Author

vdveer commented Aug 29, 2015

I can seem to squash the commits on this branch so I have set up test_pr, which I set to upstream/master and merged my featurebranch. Reset to upstream master and squashed the changes into a single commit. I will close this PR and open a new one from this branch as I can't seem to edit this one.

@vdveer vdveer closed this Aug 29, 2015
@BLeQuerrec
Copy link
Member

You can force push to vdveer:file_transfer_without_size_setting and this PR will be updated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants