class WindozAppController extends MasterController {

    ControllerReady() {
        // setting up session interactions
        if(app.User.isAuthenticated) {
            this.profile = this.content.initSession();       
        }        
    }

    onBusConnected() {
        app.MessageBus.addBusListener(
            'growl',
            ['system:notifs',
             app.config.messageBus.userNotifChan.replace(/\{uid\}/g, app.User.identity.uuid)
            ],
            (chan, payload, sender) => {
                ui.growl.append(payload.growlMessage, payload.growlSeverity, 1000*payload.growlTime)
            }
        )

        app.MessageBus.addBusListener(
            'kick',
            ['system:notifs', 
             app.config.messageBus.userNotifChan.replace(/\{uid\}/g, app.User.identity.uuid)
            ],
            (chan, payload, sender) => {
                if(app.User.hasRole('EIC_Admin') || app.User.hasRole('EIC_Dev')) return
                app.User.logout()
            }
        )
        //if('ChatModule' in app.LoadedClasses) this.chat = new ChatModule(this.content);
    }
}

app.registerClass('WindozAppController', WindozAppController);