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

Merged
sneak merged 8 commits from feature/username-hostname-support into main 2026-03-20 06:53:36 +01:00
Showing only changes of commit 67460ea6b2 - Show all commits

View File

@@ -2,6 +2,7 @@ package handlers
import ( import (
"context" "context"
"crypto/subtle"
"encoding/json" "encoding/json"
"errors" "errors"
"fmt" "fmt"
@@ -3186,7 +3187,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",