feat: add username/hostname support with IRC hostmask format #82

Open
clawbot wants to merge 6 commits from feature/username-hostname-support into main
Showing only changes of commit 427ee1e820 - Show all commits

View File

@@ -2,6 +2,7 @@ package handlers
import ( import (
"context" "context"
"crypto/subtle"
"encoding/json" "encoding/json"
"fmt" "fmt"
"net" "net"
@@ -2822,7 +2823,8 @@ func (hdlr *Handlers) handleOper(
cfgPass := hdlr.params.Config.OperPassword cfgPass := hdlr.params.Config.OperPassword
if cfgName == "" || cfgPass == "" || if cfgName == "" || cfgPass == "" ||
operName != cfgName || operPass != cfgPass { subtle.ConstantTimeCompare([]byte(operName), []byte(cfgName)) != 1 ||
subtle.ConstantTimeCompare([]byte(operPass), []byte(cfgPass)) != 1 {
hdlr.enqueueNumeric( hdlr.enqueueNumeric(
ctx, clientID, irc.ErrNoOperHost, nick, ctx, clientID, irc.ErrNoOperHost, nick,
nil, "No O-lines for your host", nil, "No O-lines for your host",