mirror of
https://git.sr.ht/~emersion/gamja
synced 2024-11-15 03:35:10 -05:00
Fix cross-network mixups when handling QUIT and NICK
Only mutate buffers if they belong to our connection.
This commit is contained in:
parent
b2cdab86aa
commit
f36bba897e
1 changed files with 6 additions and 0 deletions
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue