Fix cross-network mixups when handling QUIT and NICK

Only mutate buffers if they belong to our connection.
This commit is contained in:
Simon Ser 2021-05-27 15:19:28 +02:00
parent b2cdab86aa
commit f36bba897e

View file

@ -733,6 +733,9 @@ export default class App extends Component {
this.setState((state) => { this.setState((state) => {
var buffers = new Map(state.buffers); var buffers = new Map(state.buffers);
state.buffers.forEach((buf) => { state.buffers.forEach((buf) => {
if (buf.network != netID) {
return;
}
if (!buf.members.has(msg.prefix.name) && buf.name != msg.prefix.name) { if (!buf.members.has(msg.prefix.name) && buf.name != msg.prefix.name) {
return; return;
} }
@ -753,6 +756,9 @@ export default class App extends Component {
this.setState((state) => { this.setState((state) => {
var buffers = new Map(state.buffers); var buffers = new Map(state.buffers);
state.buffers.forEach((buf) => { state.buffers.forEach((buf) => {
if (buf.network != netID) {
return;
}
if (!buf.members.has(msg.prefix.name)) { if (!buf.members.has(msg.prefix.name)) {
return; return;
} }