Commit 1d90f443 authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Kill Message field in clientMessage.

Having both Message and Value is confusing.
parent 695cbad3
......@@ -93,7 +93,6 @@ type clientMessage struct {
Permissions userPermission `json:"permissions,omitempty"`
Group string `json:"group,omitempty"`
Value string `json:"value,omitempty"`
Message string `json:"message,omitempty"`
Me bool `json:"me,omitempty"`
Offer *webrtc.SessionDescription `json:"offer,omitempty"`
Answer *webrtc.SessionDescription `json:"answer,omitempty"`
......@@ -136,8 +135,8 @@ func startClient(conn *websocket.Conn) (err error) {
m, e := errorToWSCloseMessage(err)
if m != "" {
c.write(clientMessage{
Type: "error",
Message: m,
Type: "error",
Value: m,
})
}
select {
......
......@@ -278,8 +278,8 @@ func (c *client) error(err error) error {
switch e := err.(type) {
case userError:
return c.write(clientMessage{
Type: "error",
Message: "The server said: " + string(e),
Type: "error",
Value: "The server said: " + string(e),
})
default:
return err
......
......@@ -338,7 +338,7 @@ function serverConnect() {
addToChatbox(m.id, m.username, m.value, m.me);
break;
case 'error':
displayError(m.message);
displayError(m.value);
break;
default:
console.warn('Unexpected server message', m.type);
......
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