fix: Automatically remove expired story mention (#5300)

When a user mentions the connected Instagram page in a story, the story's content is downloaded in Chatwoot, then if the user deletes the story, the content persists in the platform.

fixes: #5258
This commit is contained in:
Tejaswini Chile
2022-12-08 18:25:24 +05:30
committed by GitHub
parent 431e2931c4
commit 7dc790a7e0
13 changed files with 111 additions and 15 deletions

View File

@@ -70,12 +70,15 @@ class Attachment < ApplicationRecord
private
def file_metadata
{
metadata = {
extension: extension,
data_url: file_url,
thumb_url: thumb_url,
file_size: file.byte_size
}
metadata[:data_url] = metadata[:thumb_url] = external_url if message.instagram_story_mention?
metadata
end
def location_metadata