From b6c47a517ce0ce741fa110d081cd3f2a8980c180 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Mon, 6 Dec 2021 22:33:50 +0100 Subject: [PATCH] Use more descriptive errors when aborting pending commands --- upstream.go | 6 +++--- user.go | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/upstream.go b/upstream.go index 4929f17..1a454d3 100644 --- a/upstream.go +++ b/upstream.go @@ -292,7 +292,7 @@ func (uc *upstreamConn) isOurNick(nick string) bool { return uc.nickCM == uc.network.casemap(nick) } -func (uc *upstreamConn) endPendingCommands() { +func (uc *upstreamConn) abortPendingCommands() { for _, l := range uc.pendingCmds { for _, pendingCmd := range l { dc := uc.downstreamByID(pendingCmd.downstreamID) @@ -305,7 +305,7 @@ func (uc *upstreamConn) endPendingCommands() { dc.SendMessage(&irc.Message{ Prefix: dc.srv.prefix(), Command: irc.RPL_LISTEND, - Params: []string{dc.nick, "End of /LIST"}, + Params: []string{dc.nick, "Command aborted"}, }) case "WHO": mask := "*" @@ -315,7 +315,7 @@ func (uc *upstreamConn) endPendingCommands() { dc.SendMessage(&irc.Message{ Prefix: dc.srv.prefix(), Command: irc.RPL_ENDOFWHO, - Params: []string{dc.nick, mask, "End of /WHO"}, + Params: []string{dc.nick, mask, "Command aborted"}, }) case "AUTHENTICATE": dc.endSASL(&irc.Message{ diff --git a/user.go b/user.go index be32ea0..78c638c 100644 --- a/user.go +++ b/user.go @@ -726,7 +726,7 @@ func (u *user) run() { func (u *user) handleUpstreamDisconnected(uc *upstreamConn) { uc.network.conn = nil - uc.endPendingCommands() + uc.abortPendingCommands() for _, entry := range uc.channels.innerMap { uch := entry.value.(*upstreamChannel)