Fix bug when room['timeline'] doesn't exist

This commit is contained in:
luk3yx
2022-11-16 13:46:07 +13:00
parent af6a763c14
commit c184810355
2 changed files with 5 additions and 4 deletions

View File

@@ -12,7 +12,7 @@ import functools, html.parser, itertools, json, math, re, threading, time, uuid
import miniirc, requests, traceback # type: ignore
ver = (0, 0, 6)
ver = (0, 0, 7)
__version__ = '.'.join(map(str, ver))
@@ -520,8 +520,9 @@ class Matrix(miniirc.IRC):
@_room_processor('join', 'leave')
def __process_join(self, room_id: str, room: dict[str, Any]) -> None:
# Joined rooms
for raw_event in room['timeline']['events']:
self.__fire_event(room_id, _Event(raw_event))
if 'timeline' in room:
for raw_event in room['timeline']['events']:
self.__fire_event(room_id, _Event(raw_event))
@_room_processor('invite')
def __process_invite(self, room_id: str, room: dict[str, Any]) -> None:

View File

@@ -5,7 +5,7 @@ from setuptools import setup
setup(
name='miniirc_matrix',
version='0.0.6',
version='0.0.7',
py_modules=['miniirc_matrix'],
author='luk3yx',
description='A Matrix wrapper for miniirc.',