Commit 3b98e123 authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Send a message of kind "kicked" instead of "error".

parent a5c97fd8
...@@ -292,8 +292,9 @@ chat history, and is not expected to contain user-visible content. ...@@ -292,8 +292,9 @@ chat history, and is not expected to contain user-visible content.
} }
``` ```
Currently defined kinds include `error`, `warning`, `info`, `clearchat` Currently defined kinds include `error`, `warning`, `info`, `kicked`,
(not to be confused with the `clearchat` group action), and `mute`. `clearchat` (not to be confused with the `clearchat` group action), and
`mute`.
A user action requests that the server act upon a user. A user action requests that the server act upon a user.
......
...@@ -1815,7 +1815,7 @@ func errorMessage(id string, err error) *clientMessage { ...@@ -1815,7 +1815,7 @@ func errorMessage(id string, err error) *clientMessage {
} }
return &clientMessage{ return &clientMessage{
Type: "usermessage", Type: "usermessage",
Kind: "error", Kind: "kicked",
Id: e.Id, Id: e.Id,
Username: e.Username, Username: e.Username,
Dest: id, Dest: id,
......
...@@ -2198,6 +2198,7 @@ async function gotJoined(kind, group, perms, status, message) { ...@@ -2198,6 +2198,7 @@ async function gotJoined(kind, group, perms, status, message) {
*/ */
function gotUserMessage(id, dest, username, time, privileged, kind, message) { function gotUserMessage(id, dest, username, time, privileged, kind, message) {
switch(kind) { switch(kind) {
case 'kicked':
case 'error': case 'error':
case 'warning': case 'warning':
case 'info': case 'info':
...@@ -2934,7 +2935,6 @@ document.getElementById('resizer').addEventListener('mousedown', chatResizer, fa ...@@ -2934,7 +2935,6 @@ document.getElementById('resizer').addEventListener('mousedown', chatResizer, fa
function displayError(message, level) { function displayError(message, level) {
if(!level) if(!level)
level = "error"; level = "error";
var background = 'linear-gradient(to right, #e20a0a, #df2d2d)'; var background = 'linear-gradient(to right, #e20a0a, #df2d2d)';
var position = 'center'; var position = 'center';
var gravity = 'top'; var gravity = 'top';
...@@ -2948,6 +2948,9 @@ function displayError(message, level) { ...@@ -2948,6 +2948,9 @@ function displayError(message, level) {
case "warning": case "warning":
background = "linear-gradient(to right, #bdc511, #c2cf01)"; background = "linear-gradient(to right, #bdc511, #c2cf01)";
break; break;
case "kicked":
level = "error";
break;
} }
/** @ts-ignore */ /** @ts-ignore */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment