feat(vcard): add url

git-svn-id: file:///srv/svn/repo/chen/trunk@13 32723744-9b23-0b4a-b1da-9b2e968f9461
This commit is contained in:
czar 2022-05-27 01:55:46 +00:00
parent d49b6500d6
commit cb14754438

10
main.py
View File

@ -227,6 +227,7 @@ class AngelBot(ClientXMPP):
self.register_plugin("xep_0084")
self.register_plugin("xep_0153")
self.register_plugin("xep_0363")
self.register_plugin("xep_0363")
self.add_event_handler("session_start", self.session_start)
self.add_event_handler("message", self.message)
@ -238,6 +239,7 @@ class AngelBot(ClientXMPP):
async def session_start(self, event):
self.send_presence()
await self.get_roster()
await self.update_info()
for channel in self.autojoin:
try:
self.plugin["xep_0045"].join_muc(channel, self.nick)
@ -258,8 +260,14 @@ class AngelBot(ClientXMPP):
"bytes": avatar_bytes,
}
asyncio.gather(self.plugin["xep_0084"].publish_avatar(avatar))
vcard = self.plugin["xep_0054"].make_vcard()
vcard["URL"] = "https://gt.kalli.st/czar/angel"
asyncio.gather(self.plugin["xep_0054"].publish_vcard(vcard))
asyncio.gather(self.plugin["xep_0084"].publish_avatar(avatar))
asyncio.gather(
self.plugin["xep_0153"].set_avatar(
avatar=avatar,