chatwoot
chatwoot copied to clipboard
fix: Handle instagram direct message images using CDN url
Describe the bug
I'm on facebook approval process and we passed History Image CDN URL process OK.
Now, facebook says if messege on Instagram Direct, is an image, we need to use Instagram CDN format (A valid CDN URL sample would be https://lookaside.fbsbx.com/ig_messaging_cdn/?asset_id...
)
I check that on my self hosted installation and chatwoot use an internal URL.
When I delete the message on Instagram, chatwoot show "This message was deleted", but not delete the image on conversation.
It's possible change that on code to use the same CDN URL on image, and delete the image for conversation when user deleted on instagram? (Similar Hisstory image functionallity) for obtain finally instagram_manage_message approve?
To Reproduce
1: Login into Instagram, search your account, go to message and send an image message 2: Back to chatwoot, open DevOptions and check de URL for the image.
Expected behavior
No response
Environment
Docker
Cloud Provider
None
Platform
Browser
Operating system
No response
Browser and version
No response
Docker (if applicable)
No response
Additional context
No response
is this resolved now?
Not yet!
Hi @pranavrajs, Do you have any idea if it is possible to resolve this, how was the Instagram story resolved? Thanks. We are waiting to resolve this issue to request facebook approval for instagram and then we make a Go Live for Chatwoot.
Hello @pranavrajs please add some priority for the fix, story issues CDN solved on v3.4.0 but I also confirm the issue on image messages. Still can't get advance Instagram permits here too.
Hello all. Could you add Priority to this issue. It's important to Facebook Approval Team to asign advance instagram permissions. Thanks a lot.
Hi! Please can you add Priority on this? Same problem here. Thanks!
Hi all. This requirement has been added after our last audit of the integration. We are looking into this.
Thanks @sojan-official
Hi all. For those who can't wait:
Go to -> app/models/attachment.rd
change
metadata[:data_url] = metadata[:thumb_url] = external_url if message.instagram_story_mention?
to
metadata[:data_url] = metadata[:thumb_url] = external_url if message.instagram?
Go to -> app/models/concerns/message_filter_helpers.rd
add
def instagram?
inbox.instagram?
end
@DenisKarlyuk would you be interested in turning this into a pull request ? 😇
@DenisKarlyuk Thanks for share that solution, we modified this files, and work perfect. Now I'm sending app revision to facebook.
@DenisKarlyuk Thanks for share that solution, we modified this files, and work perfect. Now I'm sending app revision to facebook.
Please create a Pull Request, that would be very helpfull for everyone who is facing this problem.
@pelucapampa @sojan-official Has this issue been fixed? I tested it here and even so, after deleting the file, it remained in the chat. Only the adjustment made the goal approved even though the file was maintained?
@DenisKarlyuk Thank you very much for your contribution! But when I tested the image continues to be stored by rails and displayed within chatwoot even after deletion, can you help please? I wanted to confirm whether even displaying it on the front is possible for approval.
@Elvner after the changes above and restarting the chatwoot the images should have the Instagram CDN url
@DenisKarlyuk Would it be the network url or the HTML url that generates on the front? because on the front it has the rails link, and on the network too, would there be an ideal version for these adjustments to work?
So please confirm, what matters is that the link is on Instagram, isn't the message being kept in the chat even after deletion the problem?
Thanks!!!
@Elvner Sorry, I don't remember the version, but if you did everything correctly, it should work.
To pass Facebook revision, an Instagram message (regardless of message type: image or text) must be removed from the chatwoot if it has been deleted from Instagram and links to images must be in Instagram CDN format as in the first message
@DenisKarlyuk you are going to open a PR to fix the problem in chatwoot basecode ?
@rafaelstelles this is part of how it should be, this is just a hotfix for passing Facebook revision. I can't run chatwoot locally to continue.
note: added https://github.com/chatwoot/chatwoot/pull/9287/files with the changes from @DenisKarlyuk . We will test and get this merged
Hi all. For those who can't wait: Go to ->
app/models/attachment.rd
changemetadata[:data_url] = metadata[:thumb_url] = external_url if message.instagram_story_mention?
to
metadata[:data_url] = metadata[:thumb_url] = external_url if message.instagram?
Go to ->
app/models/concerns/message_filter_helpers.rd
adddef instagram? inbox.instagram? end
@DenisKarlyuk please how do I do this with a Docker installation? I'll appreciate if you can guide. Thank you.
@tobsowo you should modify the files and than build the docker image using docker-compose.yaml
at the root of the directory.
@tobsowo you should modify the files and than build the docker image using
docker-compose.yaml
at the root of the directory.
@DenisKarlyuk Please, how do I access the file after I gain access to the shell? Will this also resolve auto deleting messages from IG and Chatwoot?
@tobsowo
- Clone Chatwoot repository -> Change the files according to the instructions above -> Build the docker image using
docker-compose.yaml
- Yes
@DenisKarlyuk I just updated to v3.9 and it does not delete messages although this fix is merged into it. @sojan-official response here https://github.com/orgs/chatwoot/discussions/9479#discussioncomment-9454013
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.