service: don't send PART if not joined in "channel delete"

This commit is contained in:
Simon Ser 2024-01-24 09:29:25 +01:00
parent 6ea4e2e1eb
commit 1f98b1f054

View file

@ -1432,7 +1432,7 @@ func handleServiceChannelDelete(ctx *serviceContext, params []string) error {
return fmt.Errorf("failed to delete channel: %v", err)
}
if uc := network.conn; uc != nil {
if uc := network.conn; uc != nil && uc.channels.Has(name) {
uc.SendMessage(ctx, &irc.Message{
Command: "PART",
Params: []string{name},