Compare commits
No commits in common. "15415a5eec256789e4031acf991d6af33f756f5e" and "d7b0b9013f30beab723dacbf75e1dd5fc8183eaa" have entirely different histories.
15415a5eec
...
d7b0b9013f
@ -1050,7 +1050,7 @@ class Portal(DBPortal, BasePortal):
|
||||
source, intent, attachment, timestamp, message_text
|
||||
))
|
||||
|
||||
async def _handle_remote_multiphoto(
|
||||
def _handle_remote_multiphoto(
|
||||
self,
|
||||
source: u.User,
|
||||
intent: IntentAPI,
|
||||
@ -1059,28 +1059,30 @@ class Portal(DBPortal, BasePortal):
|
||||
message_text: str | None,
|
||||
) -> Awaitable[list[EventID]]:
|
||||
# TODO Upload media concurrently, but post messages sequentially
|
||||
return [
|
||||
await self._handle_remote_uniphoto(
|
||||
source, intent,
|
||||
PhotoAttachment(
|
||||
shout=attachment.shout,
|
||||
mentions=attachment.mentions,
|
||||
urls=attachment.urls,
|
||||
url=attachment.imageUrls[i],
|
||||
s=attachment.sl[i],
|
||||
k=attachment.kl[i],
|
||||
w=attachment.wl[i],
|
||||
h=attachment.hl[i],
|
||||
thumbnailUrl=attachment.thumbnailUrls[i],
|
||||
thumbnailWidth=attachment.thumbnailWidths[i],
|
||||
thumbnailHeight=attachment.thumbnailHeights[i],
|
||||
cs=attachment.csl[i],
|
||||
mt=attachment.mtl[i],
|
||||
),
|
||||
timestamp, message_text,
|
||||
)
|
||||
for i in range(len(attachment.imageUrls))
|
||||
]
|
||||
return asyncio.gather(
|
||||
*[
|
||||
self._handle_remote_uniphoto(
|
||||
source, intent,
|
||||
PhotoAttachment(
|
||||
shout=attachment.shout,
|
||||
mentions=attachment.mentions,
|
||||
urls=attachment.urls,
|
||||
url=attachment.imageUrls[i],
|
||||
s=attachment.sl[i],
|
||||
k=attachment.kl[i],
|
||||
w=attachment.wl[i],
|
||||
h=attachment.hl[i],
|
||||
thumbnailUrl=attachment.thumbnailUrls[i],
|
||||
thumbnailWidth=attachment.thumbnailWidths[i],
|
||||
thumbnailHeight=attachment.thumbnailHeights[i],
|
||||
cs=attachment.csl[i],
|
||||
mt=attachment.mtl[i],
|
||||
),
|
||||
timestamp, message_text,
|
||||
)
|
||||
for i in range(len(attachment.imageUrls))
|
||||
]
|
||||
)
|
||||
|
||||
def _handle_remote_uniphoto(
|
||||
self,
|
||||
|
@ -148,26 +148,26 @@ class Puppet(DBPuppet, BasePuppet):
|
||||
|
||||
# region User info updating
|
||||
|
||||
def update_info_from_participant(
|
||||
async def update_info_from_participant(
|
||||
self,
|
||||
source: u.User,
|
||||
info: UserInfoUnion,
|
||||
update_avatar: bool = True,
|
||||
) -> Awaitable[Puppet]:
|
||||
return self._update_info(
|
||||
) -> Puppet:
|
||||
await self._update_info(
|
||||
source,
|
||||
info.nickname,
|
||||
info.profileURL,
|
||||
update_avatar
|
||||
)
|
||||
|
||||
def update_info_from_friend(
|
||||
async def update_info_from_friend(
|
||||
self,
|
||||
source: u.User,
|
||||
info: FriendStruct,
|
||||
update_avatar: bool = True,
|
||||
) -> Awaitable[Puppet]:
|
||||
return self._update_info(
|
||||
) -> Puppet:
|
||||
await self._update_info(
|
||||
source,
|
||||
info.nickName,
|
||||
info.profileImageUrl,
|
||||
|
Loading…
Reference in New Issue
Block a user