why not invite if room is restricted

This commit is contained in:
Morgan McMillian 2017-05-24 20:50:16 -07:00
parent c4707b08d0
commit 34973daf47

View file

@ -72,6 +72,17 @@ class ChannelMonitor(threading.Thread):
'user_id': user_id
}
r = requests.post(url, params=params)
if r.status_code == 403:
self.invite_room(user_id, roomid)
requests.post(url, params=params)
def invite_room(self, user_id, roomid):
url = self.matrix_api_url + '/rooms/' + roomid + "/invite"
params = {
'access_token': self.matrix_api_token,
'user_id': user_id
}
r = requests.post(url, params=params)
def send_message(self, roomid, msg):
url = self.matrix_api_url + '/rooms/' + roomid +'/send/m.room.message' + '/' + str(self.txId)