fix: Detect more image messages

This commit is contained in:
Daniel Kempkens 2023-08-16 21:30:57 +02:00
parent 8871dfae11
commit 377d4a074b
Signed by: daniel
SSH key fingerprint: SHA256:Ks/MyhQYcPRQiwMKLAKquWCdCPe3JXlb1WttgnAoSeM

View file

@ -343,8 +343,10 @@ defmodule BdfrBrowser.Importer do
conflict_target: :id
)
existing_image = message_record.message == "Image" or String.starts_with?(message_record.message, "image")
message_record =
if message_record.message == "Image" and String.starts_with?(message_content, "mxc://") do
if existing_image and String.starts_with?(message_content, "mxc://") do
changeset = Ecto.Changeset.change(message_record, %{message: message_content})
Repo.update(changeset)
else