Send multiphoto messages in order

This commit is contained in:
Andrew Ferrazzutti 2022-03-29 03:25:38 -04:00
parent d116ebefc7
commit 15415a5eec
1 changed files with 23 additions and 25 deletions

View File

@ -1050,7 +1050,7 @@ class Portal(DBPortal, BasePortal):
source, intent, attachment, timestamp, message_text
))
def _handle_remote_multiphoto(
async def _handle_remote_multiphoto(
self,
source: u.User,
intent: IntentAPI,
@ -1059,9 +1059,8 @@ class Portal(DBPortal, BasePortal):
message_text: str | None,
) -> Awaitable[list[EventID]]:
# TODO Upload media concurrently, but post messages sequentially
return asyncio.gather(
*[
self._handle_remote_uniphoto(
return [
await self._handle_remote_uniphoto(
source, intent,
PhotoAttachment(
shout=attachment.shout,
@ -1082,7 +1081,6 @@ class Portal(DBPortal, BasePortal):
)
for i in range(len(attachment.imageUrls))
]
)
def _handle_remote_uniphoto(
self,