diff --git a/internal/service/me/me.go b/internal/service/me/me.go index 7883f2aa..19a707a6 100644 --- a/internal/service/me/me.go +++ b/internal/service/me/me.go @@ -45,7 +45,8 @@ func (s *Service) OnRequest(c service.Conn, payload []byte) (service.Response, b } return &Response{ - ID: c.ID(), - Links: links, + Status: 200, + ID: c.ID(), + Links: links, }, true } diff --git a/internal/service/me/requests.go b/internal/service/me/requests.go index 5cfa13a2..21a78b02 100644 --- a/internal/service/me/requests.go +++ b/internal/service/me/requests.go @@ -17,6 +17,7 @@ package me // Response represents a response for the 'me' request. type Response struct { Request uint16 `json:"req,omitempty"` // The corresponding request ID. + Status int `json:"status"` // The status of the response ID string `json:"id"` // The private ID of the connection. Links map[string]string `json:"links,omitempty"` // The set of pre-defined channels. } diff --git a/internal/service/presence/presence.go b/internal/service/presence/presence.go index 71979ed6..ba9f43a3 100644 --- a/internal/service/presence/presence.go +++ b/internal/service/presence/presence.go @@ -90,6 +90,7 @@ func (s *Service) OnRequest(c service.Conn, payload []byte) (service.Response, b // Gather local & cluster presence who = append(who, s.getAllPresence(ssid)...) return &Response{ + Status: 200, Time: now, Event: EventTypeStatus, Channel: msg.Channel, diff --git a/internal/service/presence/requests.go b/internal/service/presence/requests.go index aae52a89..bcd94382 100644 --- a/internal/service/presence/requests.go +++ b/internal/service/presence/requests.go @@ -45,6 +45,7 @@ const ( // Response represents a state notification. type Response struct { Request uint16 `json:"req,omitempty"` // The corresponding request ID. + Status int `json:"status"` // The status of the response Time int64 `json:"time"` // The UNIX timestamp. Event EventType `json:"event"` // The event, must be "status", "subscribe" or "unsubscribe". Channel string `json:"channel"` // The target channel for the notification.