s2s: announce remote members arriving via FJOIN to local channel members
This commit is contained in:
parent
ef84846267
commit
68b80c3f82
1 changed files with 14 additions and 3 deletions
15
src/link.rs
15
src/link.rs
|
|
@ -2132,9 +2132,20 @@ impl Server {
|
||||||
}
|
}
|
||||||
adds.push((uuid, m));
|
adds.push((uuid, m));
|
||||||
}
|
}
|
||||||
if let Some(ch) = self.channels.get_mut(&key) {
|
|
||||||
for (uuid, m) in adds {
|
for (uuid, m) in adds {
|
||||||
ch.rmembers.insert(uuid, m);
|
let already = self
|
||||||
|
.channels
|
||||||
|
.get(&key)
|
||||||
|
.map(|c| c.rmembers.contains_key(&uuid))
|
||||||
|
.unwrap_or(false);
|
||||||
|
if let Some(ch) = self.channels.get_mut(&key) {
|
||||||
|
ch.rmembers.insert(uuid.clone(), m);
|
||||||
|
}
|
||||||
|
// announce the join to local members (a no-op for a brand-new channel)
|
||||||
|
if !already {
|
||||||
|
if let Some(prefix) = self.remote_users.get(&uuid).map(|r| r.prefix()) {
|
||||||
|
self.to_channel(&key, &format!(":{prefix} JOIN {chan}"), None);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
let raw = format!(
|
let raw = format!(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue