minor re-order to avoid un-nessesary code when appropriate

This commit is contained in:
Morgan McMillian 2017-05-03 20:02:11 -07:00
parent 8949029923
commit f94b5cf2fa

View file

@ -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