mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
members as map.
This commit is contained in:
parent
b82fbae597
commit
bdd8bdab72
@ -10,11 +10,11 @@ type Message struct {
|
||||
/////////////////////////////
|
||||
|
||||
type SystemInit struct {
|
||||
Event string `json:"event,omitempty"`
|
||||
MemberId string `json:"member_id"`
|
||||
ControlHost ControlHost `json:"control_host"`
|
||||
ScreenSize ScreenSize `json:"screen_size"`
|
||||
Members []MemberData `json:"members"`
|
||||
Event string `json:"event,omitempty"`
|
||||
MemberId string `json:"member_id"`
|
||||
ControlHost ControlHost `json:"control_host"`
|
||||
ScreenSize ScreenSize `json:"screen_size"`
|
||||
Members map[string]MemberData `json:"members"`
|
||||
}
|
||||
|
||||
type SystemAdmin struct {
|
||||
|
@ -23,13 +23,13 @@ func (h *MessageHandlerCtx) systemInit(session types.Session) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
members := []message.MemberData{}
|
||||
members := map[string]message.MemberData{}
|
||||
for _, session := range h.sessions.Members() {
|
||||
members = append(members, message.MemberData{
|
||||
members[session.ID()] = message.MemberData{
|
||||
ID: session.ID(),
|
||||
Name: session.Name(),
|
||||
IsAdmin: session.Admin(),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
return session.Send(
|
||||
|
Loading…
Reference in New Issue
Block a user