Keep the connection state in the status bar on /query (closes #235)
check / check (push) Waiting to run
check / check (push) Waiting to run
/query set the status bar to [connected] whatever the connection state. Before /connect, it made the status bar say [connected] while the client had no session. /query now reads the connection state with the nick, as /window does, and shows [connected] only while the client is connected, [disconnected] otherwise. TestQueryConnectionState types /query bob, connected and not, and checks the status bar. It names the two status texts as constants, because the linter asks for one once a third copy appears. Model: opus-5-5
This commit was merged in pull request #244.
This commit is contained in:
+7
-1
@@ -402,10 +402,16 @@ func (a *App) cmdQuery(nick string) {
|
||||
a.mu.Lock()
|
||||
a.target = nick
|
||||
myNick := a.nick
|
||||
connected := a.connected
|
||||
a.mu.Unlock()
|
||||
|
||||
connStatus := "disconnected"
|
||||
if connected {
|
||||
connStatus = "connected"
|
||||
}
|
||||
|
||||
a.ui.SwitchToBuffer(nick)
|
||||
a.ui.SetStatus(myNick, nick, "connected")
|
||||
a.ui.SetStatus(myNick, nick, connStatus)
|
||||
}
|
||||
|
||||
func (a *App) cmdTopic(args string) {
|
||||
|
||||
Reference in New Issue
Block a user