From last couple of days, I’m looking to figure out a way to share pictures in one-to-one chat session using Strophe and OpenFire. I’m unable to reach any conclusion yet to how to address the requirements where both users say ‘A’ and ‘B’ are connected in one-to-one chat using web clients (based on Strophe), and user ‘A’ wants to share a picture with ‘B’. As user ‘A’ uploads the picture, its thumbnail appears in user ‘B’ client shared picture area in browser. Later, if user ‘A’ removes the shared file it gets removed as well from user’s ‘B’ window.
Possible implementation I was thinking of:
- User ‘A’ uploads the file to a location from where it’s downloadable say, http://www.mydomain.com/download/filename.
- Now, the real problem how to notify user ‘B’ about it. I was thinking of if it’s possible to address this using Pub-Sub and File and Repository sharing (XEP-0214) or there is any other better way?
What I’m unable to understand with Pub-Sub is that it works like a shared service for which user ‘B’ must have knowledge about sharing service in advance and can subscribe to it. Secondly, ‘A’ and ‘B’ chatting session is private and no other user should be allowed to download/view the files shared in ‘A’ and ‘B’ session.
Looking forward on how to address this properly.