From 2 of #460 now we would have one endpoint in server which would get the file id and receivers information and will remove the file from file system and inform the sender that file has been downloaded by other person. This endpoint would be called by receiver after file is completely downloaded by receiver. Once this is called by recipient, server would know that now I don't need to store the copy of the file and meta data in database. It will remove them and inform sender using socket.io that your file has reached the destination.
Sync is necessary when file has been sent by sender but recipient was offline and didn't know. We would have the endpoint here which would tell the recipient if there is any file pending for that recipient. Recipient would know if file is there and then would call the 2 of #460 to download the file. Initially, let's keep this simple and don't make more than one file pending for recipient on server.
part of https://github.com/Cloudkibo/Android/issues/162