This commit is contained in:
parent
42ffe1d1a3
commit
52a4914d6e
1 changed files with 7 additions and 4 deletions
|
@ -41,6 +41,9 @@ def on_receive_events(transaction):
|
||||||
cmdbot.on_message(event)
|
cmdbot.on_message(event)
|
||||||
return jsonify({})
|
return jsonify({})
|
||||||
|
|
||||||
|
if 'msgtype' not in event['content']:
|
||||||
|
return jsonify({})
|
||||||
|
|
||||||
if (event['content']['msgtype'] == 'm.text'
|
if (event['content']['msgtype'] == 'm.text'
|
||||||
or event['content']['msgtype'] == 'm.notice'):
|
or event['content']['msgtype'] == 'm.notice'):
|
||||||
if user:
|
if user:
|
||||||
|
@ -163,10 +166,10 @@ def on_receive_events(transaction):
|
||||||
if event['content']['membership'] == 'invite' and 'is_direct' in event['content'] and event['content']['is_direct'] == True:
|
if event['content']['membership'] == 'invite' and 'is_direct' in event['content'] and event['content']['is_direct'] == True:
|
||||||
|
|
||||||
logging.info('>> GOT PRIVATE INVITE')
|
logging.info('>> GOT PRIVATE INVITE')
|
||||||
cmdbot.on_invite(event)
|
# cmdbot.on_invite(event)
|
||||||
addadminrm = MatrixAdminRooms(matrix_id=event['sender'], room_id=event['room_id'])
|
# addadminrm = MatrixAdminRooms(matrix_id=event['sender'], room_id=event['room_id'])
|
||||||
db.session.add(addadminrm)
|
# db.session.add(addadminrm)
|
||||||
db.session.commit()
|
# db.session.commit()
|
||||||
|
|
||||||
elif event['content']['membership'] == 'invite':
|
elif event['content']['membership'] == 'invite':
|
||||||
logging.info('>> GOT ROOM INVITE')
|
logging.info('>> GOT ROOM INVITE')
|
||||||
|
|
Loading…
Reference in a new issue