mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
member events -> session events.
This commit is contained in:
parent
dafebc79e5
commit
fa687480a9
@ -15,10 +15,10 @@ const (
|
||||
)
|
||||
|
||||
const (
|
||||
MEMBER_CREATED = "member/created"
|
||||
MEMBER_DELETED = "member/deleted"
|
||||
MEMBER_PROFILE = "member/profile"
|
||||
MEMBER_STATE = "member/state"
|
||||
SESSION_CREATED = "session/created"
|
||||
SESSION_DELETED = "session/deleted"
|
||||
SESSION_PROFILE = "session/profile"
|
||||
SESSION_STATE = "session/state"
|
||||
)
|
||||
|
||||
const (
|
||||
|
@ -9,7 +9,7 @@ import (
|
||||
func (h *MessageHandlerCtx) SessionCreated(session types.Session) error {
|
||||
h.sessions.Broadcast(
|
||||
message.MemberData{
|
||||
Event: event.MEMBER_CREATED,
|
||||
Event: event.SESSION_CREATED,
|
||||
ID: session.ID(),
|
||||
Profile: session.GetProfile(),
|
||||
State: session.GetState(),
|
||||
@ -21,7 +21,7 @@ func (h *MessageHandlerCtx) SessionCreated(session types.Session) error {
|
||||
func (h *MessageHandlerCtx) SessionDeleted(session types.Session) error {
|
||||
h.sessions.Broadcast(
|
||||
message.MemberID{
|
||||
Event: event.MEMBER_DELETED,
|
||||
Event: event.SESSION_DELETED,
|
||||
ID: session.ID(),
|
||||
}, nil)
|
||||
|
||||
@ -57,7 +57,7 @@ func (h *MessageHandlerCtx) SessionProfileChanged(session types.Session) error {
|
||||
|
||||
h.sessions.Broadcast(
|
||||
message.MemberProfile{
|
||||
Event: event.MEMBER_PROFILE,
|
||||
Event: event.SESSION_PROFILE,
|
||||
ID: session.ID(),
|
||||
MemberProfile: &profile,
|
||||
}, nil)
|
||||
@ -70,7 +70,7 @@ func (h *MessageHandlerCtx) SessionStateChanged(session types.Session) error {
|
||||
|
||||
h.sessions.Broadcast(
|
||||
message.SessionState{
|
||||
Event: event.MEMBER_STATE,
|
||||
Event: event.SESSION_STATE,
|
||||
ID: session.ID(),
|
||||
SessionState: &state,
|
||||
}, nil)
|
||||
|
Loading…
Reference in New Issue
Block a user