Skip to content

Commit

Permalink
MS Teams connector - review fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
EugeneLightsOn committed Dec 15, 2023
1 parent 1b6902b commit d19107d
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions msteams/provider/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,14 +119,16 @@ async def _prepare_attachment_download_url(self, attachment):
def _prepare_attachments(self, messages, results):
attachments = []
for message in messages:
if message is not None:
if "attachments" in message:
for attachment in message["attachments"]:
attachment["downloadUrl"] = None
if attachment["contentType"] == "reference":
if "contentUrl" in attachment:
attachments.append(attachment)
results.append(message)
if message is None:
continue
for attachment in message.get("attachments", []):
attachment["downloadUrl"] = None
if (
attachment["contentType"] == "reference"
and "contentUrl" in attachment
):
attachments.append(attachment)
results.append(message)
if len(attachments) > 0:
self.loop.run_until_complete(
self._gather_downloadable_attachments(attachments)
Expand Down

0 comments on commit d19107d

Please sign in to comment.