why not invite if room is restricted
This commit is contained in:
parent
c4707b08d0
commit
34973daf47
1 changed files with 11 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue