mirror of
https://github.com/jech/galene.git
synced 2024-11-14 12:45:58 +01:00
Kill Message field in clientMessage.
Having both Message and Value is confusing.
This commit is contained in:
parent
695cbad31c
commit
1d90f44315
3 changed files with 5 additions and 6 deletions
|
@ -93,7 +93,6 @@ type clientMessage struct {
|
||||||
Permissions userPermission `json:"permissions,omitempty"`
|
Permissions userPermission `json:"permissions,omitempty"`
|
||||||
Group string `json:"group,omitempty"`
|
Group string `json:"group,omitempty"`
|
||||||
Value string `json:"value,omitempty"`
|
Value string `json:"value,omitempty"`
|
||||||
Message string `json:"message,omitempty"`
|
|
||||||
Me bool `json:"me,omitempty"`
|
Me bool `json:"me,omitempty"`
|
||||||
Offer *webrtc.SessionDescription `json:"offer,omitempty"`
|
Offer *webrtc.SessionDescription `json:"offer,omitempty"`
|
||||||
Answer *webrtc.SessionDescription `json:"answer,omitempty"`
|
Answer *webrtc.SessionDescription `json:"answer,omitempty"`
|
||||||
|
@ -136,8 +135,8 @@ func startClient(conn *websocket.Conn) (err error) {
|
||||||
m, e := errorToWSCloseMessage(err)
|
m, e := errorToWSCloseMessage(err)
|
||||||
if m != "" {
|
if m != "" {
|
||||||
c.write(clientMessage{
|
c.write(clientMessage{
|
||||||
Type: "error",
|
Type: "error",
|
||||||
Message: m,
|
Value: m,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
select {
|
select {
|
||||||
|
|
4
group.go
4
group.go
|
@ -278,8 +278,8 @@ func (c *client) error(err error) error {
|
||||||
switch e := err.(type) {
|
switch e := err.(type) {
|
||||||
case userError:
|
case userError:
|
||||||
return c.write(clientMessage{
|
return c.write(clientMessage{
|
||||||
Type: "error",
|
Type: "error",
|
||||||
Message: "The server said: " + string(e),
|
Value: "The server said: " + string(e),
|
||||||
})
|
})
|
||||||
default:
|
default:
|
||||||
return err
|
return err
|
||||||
|
|
|
@ -338,7 +338,7 @@ function serverConnect() {
|
||||||
addToChatbox(m.id, m.username, m.value, m.me);
|
addToChatbox(m.id, m.username, m.value, m.me);
|
||||||
break;
|
break;
|
||||||
case 'error':
|
case 'error':
|
||||||
displayError(m.message);
|
displayError(m.value);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
console.warn('Unexpected server message', m.type);
|
console.warn('Unexpected server message', m.type);
|
||||||
|
|
Loading…
Reference in a new issue