diff --git a/fasi.py b/fasi.py index 6c309b1..79507ff 100644 --- a/fasi.py +++ b/fasi.py @@ -637,7 +637,7 @@ class FileUtilities: async def cache_jid_data(jabber_id, password, jid_bare, node_name=None, item_id=None, alias=None): - count = iq_disco_items_list = iq_disco_items_items_list = title = '' + count = iq_disco_items_list = iq_disco_items_items_list = node_title = title = '' jid_vcard = { 'name' : '', 'note' : '', @@ -748,14 +748,10 @@ class FileUtilities: # Group chat messages print('Group chat messages') messages = [] - if jid_kind == 'muc muc': #FIXME - print(jid_bare) - print(jid_kind) - print(alias) + if jid_kind == 'muc': action = 'Join' # TODO Create configurations for group chat preview - room_info_muc = await XmppXep0045.get_room_information(xmpp_instance, jid_bare, alias) # maxstanzas=50 - breakpoint() + room_info_muc = await XmppXep0045.get_room_information(xmpp_instance, jid_bare, alias, maxstanzas=50) if not room_info_muc: action = 'Warning' node_title = jid_info['condition'] @@ -773,7 +769,12 @@ class FileUtilities: node_note = room_info_muc['text'] services = services_sorted = None else: - messages = room_info_muc['iq'][3] + for message in room_info_muc['iq'][3]: + messages.append({ + 'id' : message['id'], + 'alias' : message['mucnick'], + 'body' : message['body'], + 'timestamp' : message['delay']['stamp'].__str__()}) messages.reverse() subject = room_info_muc['iq'][1]['subject'] #title = title or node_name diff --git a/xhtml/conference.xhtml b/xhtml/conference.xhtml index acb663b..82477ff 100644 --- a/xhtml/conference.xhtml +++ b/xhtml/conference.xhtml @@ -64,9 +64,9 @@ {% for message in messages %}