diff --git a/appservice.py b/appservice.py index a079f72..7c4219c 100644 --- a/appservice.py +++ b/appservice.py @@ -27,6 +27,12 @@ def on_receive_events(transaction): embed = None + chan = MatrixRoom.query.filter_by(room_id=event['room_id']).first() + if chan: + chan_id = chan.pnut_chan + else: + return jsonify({}) + if (event['content']['msgtype'] == 'm.text' or event['content']['msgtype'] == 'm.notice'): if user: @@ -65,11 +71,11 @@ def on_receive_events(transaction): else: text = None - chan = MatrixRoom.query.filter_by(room_id=event['room_id']).first() - if chan: - chan_id = chan.pnut_chan - else: - return jsonify({}) + # chan = MatrixRoom.query.filter_by(room_id=event['room_id']).first() + # if chan: + # chan_id = chan.pnut_chan + # else: + # return jsonify({}) if user == None and not chan.pnut_write: txId += 1