Compare commits

..

No commits in common. "15415a5eec256789e4031acf991d6af33f756f5e" and "d7b0b9013f30beab723dacbf75e1dd5fc8183eaa" have entirely different histories.

2 changed files with 31 additions and 29 deletions

View File

@ -1050,7 +1050,7 @@ class Portal(DBPortal, BasePortal):
source, intent, attachment, timestamp, message_text source, intent, attachment, timestamp, message_text
)) ))
async def _handle_remote_multiphoto( def _handle_remote_multiphoto(
self, self,
source: u.User, source: u.User,
intent: IntentAPI, intent: IntentAPI,
@ -1059,28 +1059,30 @@ class Portal(DBPortal, BasePortal):
message_text: str | None, message_text: str | None,
) -> Awaitable[list[EventID]]: ) -> Awaitable[list[EventID]]:
# TODO Upload media concurrently, but post messages sequentially # TODO Upload media concurrently, but post messages sequentially
return [ return asyncio.gather(
await self._handle_remote_uniphoto( *[
source, intent, self._handle_remote_uniphoto(
PhotoAttachment( source, intent,
shout=attachment.shout, PhotoAttachment(
mentions=attachment.mentions, shout=attachment.shout,
urls=attachment.urls, mentions=attachment.mentions,
url=attachment.imageUrls[i], urls=attachment.urls,
s=attachment.sl[i], url=attachment.imageUrls[i],
k=attachment.kl[i], s=attachment.sl[i],
w=attachment.wl[i], k=attachment.kl[i],
h=attachment.hl[i], w=attachment.wl[i],
thumbnailUrl=attachment.thumbnailUrls[i], h=attachment.hl[i],
thumbnailWidth=attachment.thumbnailWidths[i], thumbnailUrl=attachment.thumbnailUrls[i],
thumbnailHeight=attachment.thumbnailHeights[i], thumbnailWidth=attachment.thumbnailWidths[i],
cs=attachment.csl[i], thumbnailHeight=attachment.thumbnailHeights[i],
mt=attachment.mtl[i], cs=attachment.csl[i],
), mt=attachment.mtl[i],
timestamp, message_text, ),
) timestamp, message_text,
for i in range(len(attachment.imageUrls)) )
] for i in range(len(attachment.imageUrls))
]
)
def _handle_remote_uniphoto( def _handle_remote_uniphoto(
self, self,

View File

@ -148,26 +148,26 @@ class Puppet(DBPuppet, BasePuppet):
# region User info updating # region User info updating
def update_info_from_participant( async def update_info_from_participant(
self, self,
source: u.User, source: u.User,
info: UserInfoUnion, info: UserInfoUnion,
update_avatar: bool = True, update_avatar: bool = True,
) -> Awaitable[Puppet]: ) -> Puppet:
return self._update_info( await self._update_info(
source, source,
info.nickname, info.nickname,
info.profileURL, info.profileURL,
update_avatar update_avatar
) )
def update_info_from_friend( async def update_info_from_friend(
self, self,
source: u.User, source: u.User,
info: FriendStruct, info: FriendStruct,
update_avatar: bool = True, update_avatar: bool = True,
) -> Awaitable[Puppet]: ) -> Puppet:
return self._update_info( await self._update_info(
source, source,
info.nickName, info.nickName,
info.profileImageUrl, info.profileImageUrl,