Allow override of connection_id in messages
This commit is contained in:
@ -144,6 +144,7 @@ class IrisCore(object):
|
||||
})
|
||||
return {
|
||||
'status': 1,
|
||||
'connection_id': connection_id,
|
||||
'username': data['username']
|
||||
}
|
||||
|
||||
|
||||
@ -71,7 +71,10 @@ class WebsocketHandler(tornado.websocket.WebSocketHandler):
|
||||
else:
|
||||
data = {}
|
||||
|
||||
data['connection_id'] = self.connection_id
|
||||
# Handle hard-coded connection_id in messages
|
||||
# Otherwise include the origin connection of this message
|
||||
if 'connection_id' not in data:
|
||||
data['connection_id'] = self.connection_id
|
||||
|
||||
if 'request_id' in message:
|
||||
request_id = message['request_id']
|
||||
|
||||
@ -162,6 +162,7 @@ class Debug extends React.Component{
|
||||
<option value='{"method":"get_queue_metadata"}'>Get queue metadata</option>
|
||||
<option value='{"method":"broadcast","data":{"type":"browser_notification","title":"Testing","body":"This is my message"}}'>Broadcast to all clients</option>
|
||||
<option value='{"method":"deliver_message","data":{"to":"CONNECTION_ID_HERE","message":{"type":"browser_notification","title":"Testing","body":"This is my message"}}}'>Broadcast to one client</option>
|
||||
<option value='{"method":"set_username","data":{"connection_id":"CONNECTION_ID_HERE","username":"NewUsername"}}}'>Change username</option>
|
||||
<option value='{"method":"refresh_spotify_token"}'>Refresh Spotify token</option>
|
||||
<option value='{"method":"perform_upgrade"}'>Perform upgrade (beta)</option>
|
||||
</select>
|
||||
|
||||
Reference in New Issue
Block a user