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 is contained in:
@@ -1373,6 +1373,42 @@ func TestIntegrationInviteUserOnChannel(t *testing.T) {
|
||||
)
|
||||
}
|
||||
|
||||
// TestIntegrationInviteLine checks that an IRC listener user
|
||||
// invited by an IRC listener user, and then over the HTTP
|
||||
// API, gets an INVITE line from the inviter for the channel
|
||||
// each time.
|
||||
func TestIntegrationInviteLine(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
env := newTestEnv(t)
|
||||
|
||||
alice := env.dial(t)
|
||||
alice.register("alice")
|
||||
alice.joinAndDrain("#inv")
|
||||
|
||||
bob := env.dial(t)
|
||||
bob.register("bob")
|
||||
|
||||
alice.sendAndExpect("INVITE bob #inv", " 341 ")
|
||||
|
||||
got := bob.readLine()
|
||||
want := ":alice!alice@* INVITE bob #inv"
|
||||
|
||||
if got != want {
|
||||
t.Errorf("from the IRC listener: got %q, want %q", got, want)
|
||||
}
|
||||
|
||||
// The HTTP API queues an INVITE with the channel as its body.
|
||||
env.queueMessage(t, "bob", "INVITE", "carol", "bob", []string{"#inv"})
|
||||
|
||||
got = bob.readLine()
|
||||
want = ":carol!carol@* INVITE bob #inv"
|
||||
|
||||
if got != want {
|
||||
t.Errorf("over the HTTP API: got %q, want %q", got, want)
|
||||
}
|
||||
}
|
||||
|
||||
// TestIntegrationModeSecretList checks that LIST shows a +s
|
||||
// channel only to its members.
|
||||
func TestIntegrationModeSecretList(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user