[fix] Display permission denied error messages

This commit is contained in:
Fabien Quatravaux 2020-04-13 10:53:32 +02:00
parent 5640c6c108
commit a5d59df923
2 changed files with 9 additions and 0 deletions

View file

@ -408,6 +408,14 @@ class GlobalBindings {
}) })
}) })
// Log permission denied error messages
client.on('denied', (type) => {
ui.log.push({
type: 'generic',
value: 'Permission denied : '+ type
})
})
// Set own user and root channel // Set own user and root channel
this.thisUser(client.self.__ui) this.thisUser(client.self.__ui)
this.root(client.root.__ui) this.root(client.root.__ui)

View file

@ -187,6 +187,7 @@ import 'subworkers'
id = { client: id } id = { client: id }
registerEventProxy(id, client, 'error') registerEventProxy(id, client, 'error')
registerEventProxy(id, client, 'denied', it => [it])
registerEventProxy(id, client, 'newChannel', (it) => [setupChannel(id, it)]) registerEventProxy(id, client, 'newChannel', (it) => [setupChannel(id, it)])
registerEventProxy(id, client, 'newUser', (it) => [setupUser(id, it)]) registerEventProxy(id, client, 'newUser', (it) => [setupUser(id, it)])
registerEventProxy(id, client, 'message', (sender, message, users, channels, trees) => { registerEventProxy(id, client, 'message', (sender, message, users, channels, trees) => {