diff options
author | Přemysl Eric Janouch <p@janouch.name> | 2022-09-20 17:14:55 +0200 |
---|---|---|
committer | Přemysl Eric Janouch <p@janouch.name> | 2022-09-20 17:24:30 +0200 |
commit | 9327333813cbcb538f6757934be42d59c34f86d6 (patch) | |
tree | 9c4d39be99205279ba5dbd8bf488405378326f16 /xP | |
parent | 7806d4bd4eba73fd423c7d966a0ee286cde37b37 (diff) | |
download | xK-9327333813cbcb538f6757934be42d59c34f86d6.tar.gz xK-9327333813cbcb538f6757934be42d59c34f86d6.tar.xz xK-9327333813cbcb538f6757934be42d59c34f86d6.zip |
xC/xP: show own user's info in frontends
Diffstat (limited to 'xP')
-rw-r--r-- | xP/public/xP.js | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/xP/public/xP.js b/xP/public/xP.js index 93fe642..144647e 100644 --- a/xP/public/xP.js +++ b/xP/public/xP.js @@ -388,7 +388,7 @@ rpcEventHandlers.set(Relay.Event.ServerUpdate, e => { let s = servers.get(e.serverName) if (s === undefined) servers.set(e.serverName, (s = {})) - s.state = e.state + s.data = e.data }) rpcEventHandlers.set(Relay.Event.ServerRename, e => { @@ -693,14 +693,21 @@ let Status = { let Prompt = { view: vnode => { - // This should be handled differently, so don't mind the lookup. let b = buffers.get(bufferCurrent) if (b === undefined || b.server === undefined) return - let state = b.server.state + if (b.server.data.user !== undefined) { + let user = b.server.data.user + if (b.server.data.userMode) + user += `(${b.server.data.userMode})` + return m('.prompt', {}, `${user}`) + } + + // This might certainly be done more systematically. + let state = b.server.data.state for (const s in Relay.ServerState) - if (Relay.ServerState[s] == b.server.state) { + if (Relay.ServerState[s] == state) { state = s break } |