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
@ -14,7 +14,7 @@ type SystemInit struct {
|
||||
MemberId string `json:"member_id"`
|
||||
ControlHost ControlHost `json:"control_host"`
|
||||
ScreenSize ScreenSize `json:"screen_size"`
|
||||
Members []MemberData `json:"members"`
|
||||
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