|
@@ -2658,13 +2658,19 @@ func relaymsgHandler(server *Server, client *Client, msg ircmsg.Message, rb *Res
|
2658
|
2658
|
return false
|
2659
|
2659
|
}
|
2660
|
2660
|
|
|
2661
|
+ details := client.Details()
|
2661
|
2662
|
// #1647: we need to publish a full NUH. send ~u (or the configured alternative)
|
2662
|
2663
|
// as the user/ident, and send the relayer's hostname as the hostname:
|
2663
|
2664
|
ident := config.Server.CoerceIdent
|
2664
|
2665
|
if ident == "" {
|
2665
|
2666
|
ident = "~u"
|
2666
|
2667
|
}
|
2667
|
|
- hostname := client.Hostname()
|
|
2668
|
+ // #1661: if the bot has its own account, use the account cloak,
|
|
2669
|
+ // otherwise fall back to the hostname (which may be IP-derived)
|
|
2670
|
+ hostname := details.hostname
|
|
2671
|
+ if details.accountName != "" {
|
|
2672
|
+ hostname = config.Server.Cloaks.ComputeAccountCloak(details.accountName)
|
|
2673
|
+ }
|
2668
|
2674
|
nuh := fmt.Sprintf("%s!%s@%s", nick, ident, hostname)
|
2669
|
2675
|
|
2670
|
2676
|
channel.AddHistoryItem(history.Item{
|
|
@@ -2675,9 +2681,8 @@ func relaymsgHandler(server *Server, client *Client, msg ircmsg.Message, rb *Res
|
2675
|
2681
|
|
2676
|
2682
|
// 3 possibilities for tags:
|
2677
|
2683
|
// no tags, the relaymsg tag only, or the relaymsg tag together with all client-only tags
|
2678
|
|
- cnick := client.Nick()
|
2679
|
2684
|
relayTag := map[string]string{
|
2680
|
|
- caps.RelaymsgTagName: cnick,
|
|
2685
|
+ caps.RelaymsgTagName: details.nick,
|
2681
|
2686
|
}
|
2682
|
2687
|
clientOnlyTags := msg.ClientOnlyTags()
|
2683
|
2688
|
var fullTags map[string]string
|
|
@@ -2685,7 +2690,7 @@ func relaymsgHandler(server *Server, client *Client, msg ircmsg.Message, rb *Res
|
2685
|
2690
|
fullTags = relayTag
|
2686
|
2691
|
} else {
|
2687
|
2692
|
fullTags = make(map[string]string, 1+len(clientOnlyTags))
|
2688
|
|
- fullTags[caps.RelaymsgTagName] = cnick
|
|
2693
|
+ fullTags[caps.RelaymsgTagName] = details.nick
|
2689
|
2694
|
for t, v := range clientOnlyTags {
|
2690
|
2695
|
fullTags[t] = v
|
2691
|
2696
|
}
|