summaryrefslogtreecommitdiff
path: root/xP
diff options
context:
space:
mode:
Diffstat (limited to 'xP')
-rw-r--r--xP/public/xP.js15
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
}