JabberCard/jabbercard/xmpp/xep_0369.py
Schimon Jehudah, Adv. 5e495579c2 Add file PyProject;
Support display of a single pubsub node item;
Update document README;
Modularize code;
2024-11-17 17:30:38 +02:00

34 lines
1.1 KiB
Python

#!/usr/bin/python
# -*- coding: utf-8 -*-
from asyncio import TimeoutError
from slixmpp.exceptions import IqError, IqTimeout, PresenceError
class XmppXep0369:
async def get_room_information(self, jid, alias):
iq = await self['xep_0369'].join_channel(jid, alias)
breakpoint()
print('GOOD DAY! Please contact the developer!')
try:
error = False
condition = text = ''
#iq = await self['xep_0369'].get_channel_info(jid)
iq = await self['xep_0369'].join_channel(jid, alias)
except TimeoutError as e:
#raise HTTPException(status_code=504, detail='request-timeout-reached')
error = True
iq = e
condition = 'Request timeout reached'
text = str(e)
except (IqError, IqTimeout, PresenceError) as e:
error = True
iq = e
condition = e.iq['error']['condition']
text = e.iq['error']['text']
result = {
'error' : error,
'condition' : condition,
'text' : text,
'iq' : iq}
return result