Skip to content

Commit

Permalink
Fix bug when room['timeline'] doesn't exist
Browse files Browse the repository at this point in the history
  • Loading branch information
luk3yx committed Nov 16, 2022
1 parent af6a763 commit c184810
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions miniirc_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import miniirc, requests, traceback # type: ignore


ver = (0, 0, 6)
ver = (0, 0, 7)
__version__ = '.'.join(map(str, ver))


Expand Down Expand Up @@ -520,8 +520,9 @@ def __fire_event(self, room_id: str, event: _Event) -> None:
@_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:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setup(
name='miniirc_matrix',
version='0.0.6',
version='0.0.7',
py_modules=['miniirc_matrix'],
author='luk3yx',
description='A Matrix wrapper for miniirc.',
Expand Down

0 comments on commit c184810

Please sign in to comment.