mirror of
https://github.com/shazow/ssh-chat.git
synced 2025-04-18 17:57:41 +03:00
main: Skip prompt, highlight, autocomplete in bot mode
This commit is contained in:
parent
5055bbc859
commit
a3f41865fd
13
host.go
13
host.go
@ -160,9 +160,11 @@ func (h *Host) Connect(term *sshd.Terminal) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Successfully joined.
|
// Successfully joined.
|
||||||
term.SetPrompt(GetPrompt(user))
|
if !apiMode {
|
||||||
term.AutoCompleteCallback = h.AutoCompleteFunction(user)
|
term.SetPrompt(GetPrompt(user))
|
||||||
user.SetHighlight(user.Name())
|
term.AutoCompleteCallback = h.AutoCompleteFunction(user)
|
||||||
|
user.SetHighlight(user.Name())
|
||||||
|
}
|
||||||
|
|
||||||
// Should the user be op'd on join?
|
// Should the user be op'd on join?
|
||||||
if h.isOp(term.Conn) {
|
if h.isOp(term.Conn) {
|
||||||
@ -210,6 +212,11 @@ func (h *Host) Connect(term *sshd.Terminal) {
|
|||||||
// FIXME: Any reason to use h.room.Send(m) instead?
|
// FIXME: Any reason to use h.room.Send(m) instead?
|
||||||
h.HandleMsg(m)
|
h.HandleMsg(m)
|
||||||
|
|
||||||
|
if apiMode {
|
||||||
|
// Skip the remaining rendering workarounds
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
cmd := m.Command()
|
cmd := m.Command()
|
||||||
if cmd == "/nick" || cmd == "/theme" {
|
if cmd == "/nick" || cmd == "/theme" {
|
||||||
// Hijack /nick command to update terminal synchronously. Wouldn't
|
// Hijack /nick command to update terminal synchronously. Wouldn't
|
||||||
|
Loading…
x
Reference in New Issue
Block a user