Show an IRC listener user what their session sends from other clients (closes #179)
check / check (push) Canceled after 0s
check / check (push) Canceled after 0s
The relay dropped every PRIVMSG, NOTICE, JOIN, PART, NICK, QUIT, TOPIC, MODE and KICK sent under the connection's own nick, so an IRC listener connection never saw what its session did from another client. The relay now drops nothing by nick. Instead, the service methods that fan out a user's own command take the client whose queue to skip: the IRC listener passes its own client, which has already written the echo, and the HTTP API passes 0. Channel messages and PARTs now also go to the sender's own session, so the HTTP handler no longer queues the channel-message echo itself, SendChannelMessage no longer returns the message's row ID, and neoirc-cli ignores the PART event for its own part, which it has already shown. Model: opus-5-5
This commit is contained in:
+7
-3
@@ -757,7 +757,7 @@ func (a *App) handleServerMessage(msg *api.Message) {
|
||||
case irc.CmdJoin:
|
||||
a.handleJoinEvent(msg, timestamp)
|
||||
case irc.CmdPart:
|
||||
a.handlePartEvent(msg, timestamp)
|
||||
a.handlePartEvent(msg, timestamp, myNick)
|
||||
case irc.CmdQuit:
|
||||
a.handleQuitEvent(msg, timestamp)
|
||||
case irc.CmdNick:
|
||||
@@ -813,10 +813,14 @@ func (a *App) handleJoinEvent(
|
||||
))
|
||||
}
|
||||
|
||||
// handlePartEvent shows another user's part. The server
|
||||
// also sends the user's own part back to it, which cmdPart
|
||||
// has already shown; showing it again would add a second
|
||||
// line and mark the channel just left as unread.
|
||||
func (a *App) handlePartEvent(
|
||||
msg *api.Message, timestamp string,
|
||||
msg *api.Message, timestamp, myNick string,
|
||||
) {
|
||||
if msg.To == "" {
|
||||
if msg.To == "" || msg.From == myNick {
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user