matrix-hacks / matrix-puppet-facebook

a puppetted facebook bridge
98 stars 21 forks source link

Images and stickers don't work because of body === '', out of date facebook-chat-api, matrix-puppet-bridge issue #29

Closed Limvot closed 6 years ago

Limvot commented 6 years ago

Currently images and stickers currently don't get sent to the matrix side for a few reasons: body is sent as empty string, not undefined - if I check for empty string as well it works. https://github.com/matrix-hacks/matrix-puppet-facebook/blob/1e5b0d2aad0a6ad6b9a8f31344beea4e709ab483/index.js#L34

The facebook-chat-api has been updated, and I believe currently needs a version newer than is released on npm. I saw in an issue that I think they haven't fully stabilized it yet, but using master from GitHub worked for me.

Finally, an issue on matrix-puppet-bridge was causing sending the image not to complete. (https://github.com/matrix-hacks/matrix-puppet-bridge/issues/32)

I think attachment.name is should be attachment.filename here (https://github.com/matrix-hacks/matrix-puppet-facebook/blob/1e5b0d2aad0a6ad6b9a8f31344beea4e709ab483/index.js#L76)

Also, small debugging note, I believe err.stack is undefined, I had success just printing out err. https://github.com/matrix-hacks/matrix-puppet-facebook/blob/1e5b0d2aad0a6ad6b9a8f31344beea4e709ab483/client.js#L58

After making these modifications, I was able to successfully send stickers, gifs, and photos from facebook to matrix. Tenor GIF Keyboard messages don't parse in facebook-chat-api, however. (https://github.com/Schmavery/facebook-chat-api/issues/564)

Anyway, thanks for the great project! Sorry if my writing is a bit disjointed, I'm a bit tired :)

AndrewJDR commented 6 years ago

Thanks, this should be addressed now. Let me know otherwise.