Skip to content
Snippets Groups Projects
Commit 6ba18c45 authored by Tulir Asokan's avatar Tulir Asokan :cat2:
Browse files

Fix handling messages that only contain ShareAttachments

parent e782333e
No related branches found
No related tags found
No related merge requests found
...@@ -553,7 +553,8 @@ class Portal(BasePortal): ...@@ -553,7 +553,8 @@ class Portal(BasePortal):
for attachment in message.attachments]) for attachment in message.attachments])
event_ids += [attach_id for attach_id in attach_ids if attach_id] event_ids += [attach_id for attach_id in attach_ids if attach_id]
if not event_ids: if not event_ids:
if message.text: if message.text or any(x for x in message.attachments
if isinstance(x, ShareAttachment)):
event_ids = [await self._handle_facebook_text(intent, message)] event_ids = [await self._handle_facebook_text(intent, message)]
else: else:
self.log.warning(f"Unhandled Messenger message: {message}") self.log.warning(f"Unhandled Messenger message: {message}")
...@@ -634,6 +635,9 @@ class Portal(BasePortal): ...@@ -634,6 +635,9 @@ class Portal(BasePortal):
content = await self._convert_facebook_location(intent, attachment) content = await self._convert_facebook_location(intent, attachment)
content.relates_to = self._get_facebook_reply(reply_to) content.relates_to = self._get_facebook_reply(reply_to)
event_id = await self._send_message(intent, content) event_id = await self._send_message(intent, content)
elif isinstance(attachment, ShareAttachment):
# These are handled in the text formatter
return None
else: else:
self.log.warning(f"Unsupported attachment type: {attachment}") self.log.warning(f"Unsupported attachment type: {attachment}")
return None return None
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment