upstream: compare service nick with case-mapping
This commit is contained in:
parent
dc356200c2
commit
7db1be44fa
@ -494,16 +494,16 @@ func (uc *upstreamConn) handleMessage(ctx context.Context, msg *irc.Message) err
|
||||
}
|
||||
}
|
||||
|
||||
if msg.Prefix.Name == serviceNick {
|
||||
if uc.network.equalCasemap(msg.Prefix.Name, serviceNick) {
|
||||
uc.logger.Printf("skipping %v from soju's service: %v", msg.Command, msg)
|
||||
break
|
||||
}
|
||||
if target == serviceNick {
|
||||
if uc.network.equalCasemap(target, serviceNick) {
|
||||
uc.logger.Printf("skipping %v to soju's service: %v", msg.Command, msg)
|
||||
break
|
||||
}
|
||||
|
||||
if msg.Prefix.Name == uc.serverPrefix.Name || target == "*" || strings.HasPrefix(target, "$") {
|
||||
if uc.network.equalCasemap(msg.Prefix.Name, uc.serverPrefix.Name) || target == "*" || strings.HasPrefix(target, "$") {
|
||||
// This is a server message
|
||||
uc.produce("", msg, 0)
|
||||
break
|
||||
|
4
user.go
4
user.go
@ -179,6 +179,10 @@ func (net *network) isStopped() bool {
|
||||
}
|
||||
}
|
||||
|
||||
func (net *network) equalCasemap(a, b string) bool {
|
||||
return net.casemap(a) == net.casemap(b)
|
||||
}
|
||||
|
||||
func userIdent(u *database.User) string {
|
||||
// The ident is a string we will send to upstream servers in clear-text.
|
||||
// For privacy reasons, make sure it doesn't expose any meaningful user
|
||||
|
Loading…
Reference in New Issue
Block a user