fix redirects, fix server syncs on join

This commit is contained in:
Katalina / stardust 2018-01-17 23:12:11 -06:00
parent 032831aff1
commit f7238ab091
14 changed files with 132 additions and 101 deletions

View file

@ -10,6 +10,15 @@ class PresentationService extends Service {
this.cache = LRU({ max: 500, maxAge: 100 * 60 * 5 })
}
serverSlug (server) {
return {
id: server.id,
name: server.name,
ownerID: server.ownerID,
icon: server.icon
}
}
async oldPresentableServers (collection, userId) {
let servers = []
@ -39,12 +48,7 @@ class PresentationService extends Service {
nickname: gm.nickname,
color: gm.displayHexColor
},
server: {
id: server.id,
name: server.name,
ownerID: server.ownerID,
icon: server.icon
},
server: this.serverSlug(server),
roles: (incRoles) ? (await this.rolesByServer(server, sd)).map(r => ({ ...r, selected: gm.roles.has(r.id) })) : [],
message: sd.message,
categories: sd.categories,