diff --git a/irc/errors.go b/irc/errors.go index 34f7fcdb..1f0d09f2 100644 --- a/irc/errors.go +++ b/irc/errors.go @@ -54,6 +54,7 @@ var ( errConfusableIdentifier = errors.New("This identifier is confusable with one already in use") errInsufficientPrivs = errors.New("Insufficient privileges") errInvalidUsername = errors.New("Invalid username") + errInvalidTarget = errors.New("Invalid target") errFeatureDisabled = errors.New(`That feature is disabled`) errBanned = errors.New("IP or nickmask banned") errInvalidParams = utils.ErrInvalidParams diff --git a/irc/server.go b/irc/server.go index 1a7e1abd..4d4b3677 100644 --- a/irc/server.go +++ b/irc/server.go @@ -1061,6 +1061,8 @@ func (server *Server) DeleteMessage(target, msgid, accountName string) (err erro if status, _, _ := channel.historyStatus(config); status == HistoryEphemeral { hist = &channel.history } + } else { + return errNoSuchChannel } } else { client := server.clients.Get(target) @@ -1068,6 +1070,8 @@ func (server *Server) DeleteMessage(target, msgid, accountName string) (err erro if status, _ := client.historyStatus(config); status == HistoryEphemeral { hist = &client.history } + } else { + return errInvalidTarget } } }