mirror of
https://codeberg.org/emersion/gamja
synced 2025-03-12 23:43:42 +01:00
fix ping after reconnect
client.setPingInterval was only called once in app.connect(), but client.disconnect() disables it, and the ping timer is never again set, even though the client can reconnect. the change passes the ping time as a parameter to the client, and the client calls setPingInterval() after a successful WS open event.
This commit is contained in:
parent
f465e24adf
commit
1142145c6d
@ -159,6 +159,7 @@ export default class App extends Component {
|
||||
saslExternal: false,
|
||||
autoconnect: false,
|
||||
autojoin: [],
|
||||
ping: 0,
|
||||
},
|
||||
connectForm: true,
|
||||
loading: true,
|
||||
@ -253,6 +254,9 @@ export default class App extends Component {
|
||||
if (config.server.auth === "external") {
|
||||
connectParams.saslExternal = true;
|
||||
}
|
||||
if (typeof config.server.ping === "number") {
|
||||
connectParams.ping = config.server.ping;
|
||||
}
|
||||
}
|
||||
|
||||
let autoconnect = store.autoconnect.load();
|
||||
@ -652,10 +656,6 @@ export default class App extends Component {
|
||||
if (params.autojoin.length > 0) {
|
||||
this.switchToChannel = params.autojoin[0];
|
||||
}
|
||||
|
||||
if (this.config.server && typeof this.config.server.ping !== "undefined") {
|
||||
client.setPingInterval(this.config.server.ping);
|
||||
}
|
||||
}
|
||||
|
||||
disconnect(serverID) {
|
||||
|
@ -122,6 +122,7 @@ export default class Client extends EventTarget {
|
||||
saslPlain: null,
|
||||
saslExternal: false,
|
||||
bouncerNetwork: null,
|
||||
ping: 0,
|
||||
};
|
||||
debug = false;
|
||||
batches = new Map();
|
||||
@ -244,6 +245,7 @@ export default class Client extends EventTarget {
|
||||
this.setStatus(Client.Status.REGISTERING);
|
||||
|
||||
this.reconnectBackoff.reset();
|
||||
this.setPingInterval(this.params.ping);
|
||||
|
||||
this.nick = this.params.nick;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user