Browse Source

Fix nick message handling for status window

master
Tyler Sommer 1 year ago
parent
commit
bf16198125
Signed by: tyler-sommer GPG Key ID: C09C010500DBD008
  1. 8
      server.go
  2. 2
      window_writer.go

8
server.go

@ -3,7 +3,6 @@ package squirssi
import (
"fmt"
"os"
"sync"
"time"
@ -320,12 +319,15 @@ func (srv *Server) startUIEventLoop() {
panic(fmt.Sprintf("received termui Resize event but Payload was unexpected type %T", e.Payload))
}
srv.resize(resize.Width, resize.Height)
fmt.Fprintf(os.Stderr, "resize event: new size %dx%d\n", resize.Width, resize.Height)
// logrus.Debugf("resize event: new size %dx%d", resize.Width, resize.Height)
srv.events.Emit("ui.RESIZE", map[string]interface{}{
"width": resize.Width,
"height": resize.Height,
})
// todo: its unclear why, but after much frustration, i've
// decided i'm ok with the hack: when the screen is resized
// in tmux, it needs two renders to fully display properly.
// so every time there is a resize, force a render and emit a
// good old fashioned ui.DIRTY event.
srv.doRender(true)
srv.events.Emit("ui.DIRTY", nil)
}

2
window_writer.go

@ -135,7 +135,7 @@ func WriteNick(wm *WindowManager, nick Nick, newNick Nick) {
logrus.Warnln("failed to write nick change:", err)
}
}
} else if win.Title() == "status" {
} else if win.Title() == "status" && nick.me {
if _, err := win.Write([]byte(fmt.Sprintf("%s[│](fg:grey) You are now known as %s", padding, newNick))); err != nil {
logrus.Warnln("failed to write nick change:", err)
}

Loading…
Cancel
Save