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
63fbbeaa09
commit
6a90cd11d2
@ -69,7 +69,7 @@ export class NekoMessages extends EventEmitter<NekoEvents> {
|
||||
Vue.set(this.state.control, 'implicit_hosting', conf.implicit_hosting)
|
||||
|
||||
for (const id in conf.members) {
|
||||
this[EVENT.MEMBER_CREATED](conf.members[id])
|
||||
this[EVENT.SESSION_CREATED](conf.members[id])
|
||||
}
|
||||
|
||||
this[EVENT.SCREEN_UPDATED](conf.screen_size)
|
||||
@ -123,26 +123,26 @@ export class NekoMessages extends EventEmitter<NekoEvents> {
|
||||
// Member Events
|
||||
/////////////////////////////
|
||||
|
||||
protected [EVENT.MEMBER_CREATED]({ id, ...data }: message.MemberData) {
|
||||
this._log.debug('EVENT.MEMBER_CREATED', id)
|
||||
protected [EVENT.SESSION_CREATED]({ id, ...data }: message.MemberData) {
|
||||
this._log.debug('EVENT.SESSION_CREATED', id)
|
||||
Vue.set(this.state.members, id, data)
|
||||
this.emit('member.created', id)
|
||||
}
|
||||
|
||||
protected [EVENT.MEMBER_DELETED]({ id }: message.MemberID) {
|
||||
this._log.debug('EVENT.MEMBER_DELETED', id)
|
||||
protected [EVENT.SESSION_DELETED]({ id }: message.MemberID) {
|
||||
this._log.debug('EVENT.SESSION_DELETED', id)
|
||||
Vue.delete(this.state.members, id)
|
||||
this.emit('member.deleted', id)
|
||||
}
|
||||
|
||||
protected [EVENT.MEMBER_PROFILE]({ id, ...profile }: message.MemberProfile) {
|
||||
this._log.debug('EVENT.MEMBER_PROFILE', id)
|
||||
protected [EVENT.SESSION_PROFILE]({ id, ...profile }: message.MemberProfile) {
|
||||
this._log.debug('EVENT.SESSION_PROFILE', id)
|
||||
Vue.set(this.state.members[id], 'profile', profile)
|
||||
this.emit('member.updated', id)
|
||||
}
|
||||
|
||||
protected [EVENT.MEMBER_STATE]({ id, ...state }: message.SessionState) {
|
||||
this._log.debug('EVENT.MEMBER_STATE', id)
|
||||
protected [EVENT.SESSION_STATE]({ id, ...state }: message.SessionState) {
|
||||
this._log.debug('EVENT.SESSION_STATE', id)
|
||||
Vue.set(this.state.members[id], 'state', state)
|
||||
this.emit('member.updated', id)
|
||||
}
|
||||
|
@ -8,10 +8,10 @@ export const SIGNAL_PROVIDE = 'signal/provide'
|
||||
export const SIGNAL_CANDIDATE = 'signal/candidate'
|
||||
export const SIGNAL_VIDEO = 'signal/video'
|
||||
|
||||
export const MEMBER_CREATED = 'member/created'
|
||||
export const MEMBER_DELETED = 'member/deleted'
|
||||
export const MEMBER_PROFILE = 'member/profile'
|
||||
export const MEMBER_STATE = 'member/state'
|
||||
export const SESSION_CREATED = 'session/created'
|
||||
export const SESSION_DELETED = 'session/deleted'
|
||||
export const SESSION_PROFILE = 'session/profile'
|
||||
export const SESSION_STATE = 'session/state'
|
||||
|
||||
export const CONTROL_HOST = 'control/host'
|
||||
export const CONTROL_RELEASE = 'control/release'
|
||||
|
Loading…
Reference in New Issue
Block a user