Show neoirc-cli's own messages, joins and parts from the server's events (closes #186)
check / check (push) Waiting to run
check / check (push) Waiting to run
neoirc-cli wrote its own line when it sent a message, joined or parted, and ignored the server's event for its own nick, except a JOIN, so a join showed twice and what the session did from another client never showed. The HTTP API queues these events to every client of the session, so the CLI now writes no line of its own when it sends and shows the event as it shows anyone else's. A direct message the user sent goes in the recipient's buffer. The user's own part does not mark the channel unread, as the user has just left it. Model: opus-5-5
This commit is contained in:
@@ -95,6 +95,19 @@ func (ui *UI) AddLine(bufferName, line string) {
|
||||
})
|
||||
}
|
||||
|
||||
// AddLineAsRead adds a line to the specified buffer, as
|
||||
// AddLine does, but does not mark the buffer unread.
|
||||
func (ui *UI) AddLineAsRead(bufferName, line string) {
|
||||
ui.app.QueueUpdateDraw(func() {
|
||||
buf := ui.getOrCreateBuffer(bufferName)
|
||||
buf.Lines = append(buf.Lines, line)
|
||||
|
||||
if ui.buffers[ui.currentBuffer] == buf {
|
||||
_, _ = fmt.Fprintln(ui.messages, line)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// AddStatus adds a line to the status buffer.
|
||||
func (ui *UI) AddStatus(line string) {
|
||||
ts := time.Now().Format("15:04")
|
||||
|
||||
Reference in New Issue
Block a user