mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
replace old Member structures.
This commit is contained in:
parent
6599a093c0
commit
b82fbae597
@ -48,13 +48,11 @@ type SignalAnswer struct {
|
||||
// Member
|
||||
/////////////////////////////
|
||||
|
||||
// TODO: New.
|
||||
type MemberID struct {
|
||||
Event string `json:"event,omitempty"`
|
||||
ID string `json:"id"`
|
||||
}
|
||||
|
||||
// TODO: New.
|
||||
type MemberData struct {
|
||||
Event string `json:"event,omitempty"`
|
||||
ID string `json:"id"`
|
||||
@ -137,17 +135,3 @@ type BroadcastStatus struct {
|
||||
IsActive bool `json:"is_active"`
|
||||
URL string `json:"url,omitempty"`
|
||||
}
|
||||
|
||||
// TODO: Remove.
|
||||
type Member struct {
|
||||
Event string `json:"event"`
|
||||
ID string `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Admin bool `json:"admin"`
|
||||
}
|
||||
|
||||
// TODO: Remove.
|
||||
type MemberDisconnected struct {
|
||||
Event string `json:"event"`
|
||||
ID string `json:"id"`
|
||||
}
|
||||
|
@ -19,11 +19,11 @@ func (h *MessageHandlerCtx) SessionConnected(session types.Session) error {
|
||||
|
||||
// let everyone know there is a new session
|
||||
h.sessions.Broadcast(
|
||||
message.Member{
|
||||
Event: event.MEMBER_CONNECTED,
|
||||
ID: session.ID(),
|
||||
Name: session.Name(),
|
||||
Admin: session.Admin(),
|
||||
message.MemberData{
|
||||
Event: event.MEMBER_CONNECTED,
|
||||
ID: session.ID(),
|
||||
Name: session.Name(),
|
||||
IsAdmin: session.Admin(),
|
||||
}, nil)
|
||||
|
||||
return nil
|
||||
@ -43,7 +43,7 @@ func (h *MessageHandlerCtx) SessionDisconnected(session types.Session) error {
|
||||
|
||||
// let everyone know session disconnected
|
||||
h.sessions.Broadcast(
|
||||
message.MemberDisconnected{
|
||||
message.MemberID{
|
||||
Event: event.MEMBER_DISCONNECTED,
|
||||
ID: session.ID(),
|
||||
}, nil);
|
||||
|
Loading…
Reference in New Issue
Block a user