Relay INVITE to IRC listener users as an INVITE line (closes #147)
check / check (push) Waiting to run
check / check (push) Waiting to run
An invite for an IRC listener user arrived as a server NOTICE that did not name the inviter, so no IRC client treated it as an invite. The relay now sends it as an INVITE line from the inviter, with the channel taken from the message body, and sends nothing when the body names no channel. The IRC listener now queues the INVITE with the channel as its body, as the HTTP API already did, so an invite from either transport has the same shape. The README's IRC listener section says how an invite arrives. Model: opus-5-5
This commit was merged in pull request #180.
This commit is contained in:
@@ -358,16 +358,24 @@ func (c *Conn) deliverKickMsg(
|
||||
}
|
||||
}
|
||||
|
||||
// deliverInviteMsg sends an INVITE notification.
|
||||
// deliverInviteMsg sends an INVITE line from the inviter
|
||||
// for the channel named in text, or nothing when text names
|
||||
// no channel.
|
||||
func (c *Conn) deliverInviteMsg(
|
||||
_ *db.IRCMessage,
|
||||
msg *db.IRCMessage,
|
||||
text string,
|
||||
) {
|
||||
if text == "" {
|
||||
return
|
||||
}
|
||||
|
||||
c.mu.Lock()
|
||||
nick := c.nick
|
||||
c.mu.Unlock()
|
||||
|
||||
c.sendFromServer("NOTICE", nick, text)
|
||||
prefix := msg.From + "!" + msg.From + "@*"
|
||||
|
||||
c.send(FormatMessage(prefix, "INVITE", nick, text))
|
||||
}
|
||||
|
||||
// deliverWallops sends a WALLOPS notification.
|
||||
|
||||
Reference in New Issue
Block a user