blakesmith / flamethrower

Flamethrower gives you the power to use your awesome irc client to talk in your campfire rooms
MIT License
39 stars 2 forks source link

Messages with type "UploadMessage" should get translated to a URL #10

Open blakesmith opened 13 years ago

blakesmith commented 13 years ago

Right now in flamethrower, messages with type "UploadMessage" coming from the streaming API get silently dropped. We need to figure out a way to translate these messages into a URL that can be sent to the user so they can still view the URL in a browser.

A JSON message like this:

{"room_id":73541,"created_at":"2011/01/12 15:24:25 +0000","body":"Steak.jpeg","id":298466819,"user_id":786985,"type":"UploadMessage"}

Should get translated to this URL:

https://thepoint.campfirenow.com/room/73541/uploads/1711244/Steak.jpeg

Not sure if this is programmatically possible since we don't get the upload id from the JSON message (in this case 1711244). Need to investigate further.

jwm commented 11 years ago

I noticed the same thing (the upload ID isn't in the live stream's message). I e-mailed 37signals support and they confirmed that the only way to get the upload ID or upload URL is to fetch the list of recent uploads (uploads.{json,xml}) and look for the matching creation date and filename. :-(