now direct messaging fully works
This commit is contained in:
@@ -249,6 +249,7 @@ func HttpHandleUserMessage(response http.ResponseWriter, request *http.Request)
|
||||
}
|
||||
|
||||
WsSendToUser(user, target, message)
|
||||
response.WriteHeader(http.StatusAccepted)
|
||||
}
|
||||
|
||||
func HttpHandleUserNewConnection(response http.ResponseWriter, request *http.Request) {
|
||||
|
||||
@@ -386,7 +386,9 @@
|
||||
|
||||
function wsAuth() {
|
||||
if (!ws) { log('WS', 'not connected', 'log-err'); return; }
|
||||
const token = document.getElementById('ws-token').value;
|
||||
const el = document.getElementById('ws-token');
|
||||
const token = el ? el.value : currentToken;
|
||||
if (!token) { log('WS', 'no token to auth with', 'log-err'); return; }
|
||||
const msg = JSON.stringify({ token });
|
||||
ws.send(msg);
|
||||
log('WS →', msg, 'log-info');
|
||||
|
||||
Reference in New Issue
Block a user