zerowidth / camper_van

A Campfire to IRC bridge
MIT License
129 stars 25 forks source link

File upload links incorrect #14

Closed chrissearle closed 11 years ago

chrissearle commented 12 years ago

When a user uploads a file they get a link something like:

https://subdomain.campfirenow.com/room/ID1/uploads/ID2/filename

In the IRC channel this arrives as

ACTION   uploaded https://subdomain.campfirenow.com/room/ID1/uploads/ID3/filename

so - the second ID part of the URL has a different value and therefore the link doesn't work.

Am guessing the first ID is the room number - but what the second is (or where the third comes from in the IRC ACTION call) I have no clue.

zerowidth commented 12 years ago

I'm able to reproduce this, but don't have a good solution yet.

mikeknoop commented 11 years ago

I've reproduced this too. Can you elaborate what the crux of the problem is in case someone wanted to take a stab at fixing it?

zerowidth commented 11 years ago

Alright, after some digging, it looks like the campfire streaming API doesn't return the url for an upload in the json for an UploadMessage. Had to make a separate API call to get the full url for the uploaded file.

This bugfix is on master, please try it out and let me know and I can cut a new release. Thanks!

chrissearle commented 11 years ago

Semi-weird :)

Got someone to upload a jpeg.

The old gem - as before gave me

https://subdomain.campfirenow.com/room/ID1/uploads/ID2/filename.jpg

The campfire web view gives

https://subdomain.campfirenow.com/room/ID1/uploads/ID3/filename.jpg

The new gem gave me

https://subdomain.campfirenow.com/room/ID1/uploads/ID3/filename.jp

So the last letter was truncated - but the download still worked

zerowidth commented 11 years ago

Hah, weird! I checked the logs for my development work on testing this, and it had the full filenames.. so who knows! But cool, I'll cut a new release. Thanks for testing it!