diff --git a/irc/channelmanager.go b/irc/channelmanager.go index 5934ab43..f5bbed39 100644 --- a/irc/channelmanager.go +++ b/irc/channelmanager.go @@ -206,6 +206,10 @@ func (cm *ChannelManager) Cleanup(channel *Channel) { } func (cm *ChannelManager) SetRegistered(channelName string, account string) (err error) { + if account == "" { + return errAuthRequired // this is already enforced by ChanServ, but do a final check + } + if cm.server.Defcon() <= 4 { return errFeatureDisabled } diff --git a/irc/errors.go b/irc/errors.go index aed797eb..6c3a790a 100644 --- a/irc/errors.go +++ b/irc/errors.go @@ -33,6 +33,7 @@ var ( errAccountVerificationInvalidCode = errors.New("Invalid account verification code") errAccountUpdateFailed = errors.New(`Error while updating your account information`) errAccountMustHoldNick = errors.New(`You must hold that nickname in order to register it`) + errAuthRequired = errors.New("You must be logged into an account to do this") errAuthzidAuthcidMismatch = errors.New(`authcid and authzid must be the same`) errCertfpAlreadyExists = errors.New(`An account already exists for your certificate fingerprint`) errChannelNotOwnedByAccount = errors.New("Channel not owned by the specified account")