Compare commits
2 Commits
d7b0b9013f
...
15415a5eec
Author | SHA1 | Date | |
---|---|---|---|
15415a5eec | |||
d116ebefc7 |
@ -1050,7 +1050,7 @@ class Portal(DBPortal, BasePortal):
|
|||||||
source, intent, attachment, timestamp, message_text
|
source, intent, attachment, timestamp, message_text
|
||||||
))
|
))
|
||||||
|
|
||||||
def _handle_remote_multiphoto(
|
async def _handle_remote_multiphoto(
|
||||||
self,
|
self,
|
||||||
source: u.User,
|
source: u.User,
|
||||||
intent: IntentAPI,
|
intent: IntentAPI,
|
||||||
@ -1059,9 +1059,8 @@ 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 asyncio.gather(
|
return [
|
||||||
*[
|
await self._handle_remote_uniphoto(
|
||||||
self._handle_remote_uniphoto(
|
|
||||||
source, intent,
|
source, intent,
|
||||||
PhotoAttachment(
|
PhotoAttachment(
|
||||||
shout=attachment.shout,
|
shout=attachment.shout,
|
||||||
@ -1082,7 +1081,6 @@ class Portal(DBPortal, BasePortal):
|
|||||||
)
|
)
|
||||||
for i in range(len(attachment.imageUrls))
|
for i in range(len(attachment.imageUrls))
|
||||||
]
|
]
|
||||||
)
|
|
||||||
|
|
||||||
def _handle_remote_uniphoto(
|
def _handle_remote_uniphoto(
|
||||||
self,
|
self,
|
||||||
|
@ -148,26 +148,26 @@ class Puppet(DBPuppet, BasePuppet):
|
|||||||
|
|
||||||
# region User info updating
|
# region User info updating
|
||||||
|
|
||||||
async def update_info_from_participant(
|
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,
|
||||||
) -> Puppet:
|
) -> Awaitable[Puppet]:
|
||||||
await self._update_info(
|
return self._update_info(
|
||||||
source,
|
source,
|
||||||
info.nickname,
|
info.nickname,
|
||||||
info.profileURL,
|
info.profileURL,
|
||||||
update_avatar
|
update_avatar
|
||||||
)
|
)
|
||||||
|
|
||||||
async def update_info_from_friend(
|
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,
|
||||||
) -> Puppet:
|
) -> Awaitable[Puppet]:
|
||||||
await self._update_info(
|
return self._update_info(
|
||||||
source,
|
source,
|
||||||
info.nickName,
|
info.nickName,
|
||||||
info.profileImageUrl,
|
info.profileImageUrl,
|
||||||
|
Loading…
Reference in New Issue
Block a user