minor re-order to avoid un-nessesary code when appropriate
This commit is contained in:
parent
8949029923
commit
f94b5cf2fa
1 changed files with 11 additions and 5 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue