diff --git a/pnut-bridge.py b/pnut-bridge.py index 586eadb..71fe894 100644 --- a/pnut-bridge.py +++ b/pnut-bridge.py @@ -78,11 +78,14 @@ class ChannelMonitor(threading.Thread): def invite_room(self, user_id, roomid): url = self.matrix_api_url + '/rooms/' + roomid + "/invite" + headers = {"Content-Type": "application/json"} params = { 'access_token': self.matrix_api_token, + } + body = { 'user_id': user_id } - r = requests.post(url, params=params) + r = requests.post(url, headers=headers, params=params, data=json.dumps(body)) def send_message(self, roomid, msg): url = self.matrix_api_url + '/rooms/' + roomid +'/send/m.room.message' + '/' + str(self.txId)