From f5de94cf3ed11bdc1ddb312f541f489f10f5f871 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonin=20D=C3=A9cimo?= Date: Mon, 14 Dec 2020 10:35:12 +0100 Subject: [PATCH] Correct spelling of privileged. --- rtpconn/webclient.go | 10 +++++----- static/galene.js | 12 ++++++------ static/protocol.js | 10 +++++----- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/rtpconn/webclient.go b/rtpconn/webclient.go index 4625581..99b44c8 100644 --- a/rtpconn/webclient.go +++ b/rtpconn/webclient.go @@ -32,7 +32,7 @@ func errorToWSCloseMessage(id string, err error) (*clientMessage, []byte) { Type: "usermessage", Kind: "error", Dest: id, - Priviledged: true, + Privileged: true, Value: &s, } text = e.Error() @@ -168,7 +168,7 @@ type clientMessage struct { Dest string `json:"dest,omitempty"` Username string `json:"username,omitempty"` Password string `json:"password,omitempty"` - Priviledged bool `json:"priviledged,omitempty"` + Privileged bool `json:"privileged,omitempty"` Permissions *group.ClientPermissions `json:"permissions,omitempty"` Group string `json:"group,omitempty"` Value *string `json:"value,omitempty"` @@ -1181,7 +1181,7 @@ func handleClientMessage(c *webClient, m clientMessage) error { Id: m.Id, Dest: m.Dest, Username: m.Username, - Priviledged: c.permissions.Op, + Privileged: c.permissions.Op, Time: tm, Kind: m.Kind, Value: m.Value, @@ -1430,7 +1430,7 @@ func errorMessage(id string, err error) *clientMessage { Type: "usermessage", Kind: "error", Dest: id, - Priviledged: true, + Privileged: true, Value: &message, } case group.KickError: @@ -1444,7 +1444,7 @@ func errorMessage(id string, err error) *clientMessage { Id: e.Id, Username: e.Username, Dest: id, - Priviledged: true, + Privileged: true, Value: &message, } default: diff --git a/static/galene.js b/static/galene.js index e9fd141..43f6517 100644 --- a/static/galene.js +++ b/static/galene.js @@ -1587,7 +1587,7 @@ let lastMessage = {}; * @param {string} kind * @param {string} message */ -function addToChatbox(peerId, dest, nick, time, priviledged, kind, message) { +function addToChatbox(peerId, dest, nick, time, privileged, kind, message) { let userpass = getUserPass(); let row = document.createElement('div'); row.classList.add('message-row'); @@ -2263,25 +2263,25 @@ async function serverConnect() { serverConnection.onjoined = gotJoined; serverConnection.onchat = addToChatbox; serverConnection.onclearchat = clearChat; - serverConnection.onusermessage = function(id, dest, username, time, priviledged, kind, message) { + serverConnection.onusermessage = function(id, dest, username, time, privileged, kind, message) { switch(kind) { case 'error': case 'warning': case 'info': let from = id ? (username || 'Anonymous') : 'The Server'; - if(priviledged) + if(privileged) displayError(`${from} said: ${message}`, kind); else - console.error(`Got unpriviledged message of kind ${kind}`); + console.error(`Got unprivileged message of kind ${kind}`); break; case 'mute': console.log(id, dest, username); - if(priviledged) { + if(privileged) { setLocalMute(true, true); let by = username ? ' by ' + username : ''; displayWarning(`You have been muted${by}`); } else { - console.error(`Got unpriviledged message of kind ${kind}`); + console.error(`Got unprivileged message of kind ${kind}`); } break; default: diff --git a/static/protocol.js b/static/protocol.js index 7f9dad2..fb750b6 100644 --- a/static/protocol.js +++ b/static/protocol.js @@ -127,7 +127,7 @@ function ServerConnection() { /** * onchat is called whenever a new chat message is received. * - * @type {(this: ServerConnection, id: string, dest: string, username: string, time: number, priviledged: boolean, kind: string, message: string) => void} + * @type {(this: ServerConnection, id: string, dest: string, username: string, time: number, privileged: boolean, kind: string, message: string) => void} */ this.onchat = null; /** @@ -136,10 +136,10 @@ function ServerConnection() { * a user-id otherwise. * * 'kind' is typically one of 'error', 'warning', 'info' or 'mute'. If - * 'id' is non-null, 'priviledged' indicates whether the message was + * 'id' is non-null, 'privileged' indicates whether the message was * sent by an operator. * - * @type {(this: ServerConnection, id: string, dest: string, username: string, time: number, priviledged: boolean, kind: string, message: string) => void} + * @type {(this: ServerConnection, id: string, dest: string, username: string, time: number, privileged: boolean, kind: string, message: string) => void} */ this.onusermessage = null; /** @@ -159,7 +159,7 @@ function ServerConnection() { * @property {string} [dest] * @property {string} [username] * @property {string} [password] - * @property {boolean} [priviledged] + * @property {boolean} [privileged] * @property {Object} [permissions] * @property {string} [group] * @property {string} [value] @@ -317,7 +317,7 @@ ServerConnection.prototype.connect = async function(url) { if(sc.onusermessage) sc.onusermessage.call( sc, m.id, m.dest, m.username, m.time, - m.priviledged, m.kind, m.value, + m.privileged, m.kind, m.value, ); break; case 'clearchat':