2 Commits

Author SHA1 Message Date
luk3yx
c184810355 Fix bug when room['timeline'] doesn't exist 2022-11-16 13:46:07 +13:00
luk3yx
af6a763c14 Bugfix 2022-05-22 17:50:30 +12:00
2 changed files with 6 additions and 5 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, 5)
ver = (0, 0, 7)
__version__ = '.'.join(map(str, ver))
@@ -398,7 +398,7 @@ class Matrix(miniirc.IRC):
# Non-SSL localhost connections are probably to
# https://github.com/matrix-org/pantalaimon which doesn't support
# the "v3" URLs yet.
matrix_url = f'http://{hostname}'
baseurl = f'http://{hostname}'
api_version = 'r0'
else:
api_version = 'v3'
@@ -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.5',
version='0.0.7',
py_modules=['miniirc_matrix'],
author='luk3yx',
description='A Matrix wrapper for miniirc.',