WIP yield reset

This commit is contained in:
Xavier Del Campo Romero 2023-10-09 22:35:58 +02:00
parent 946d113aad
commit e0417a8a4d
Signed by: xavi
GPG Key ID: 84FF3612A9BF43F2
1 changed files with 9 additions and 5 deletions

View File

@ -228,7 +228,7 @@ public class ConnectionManager : Object {
debug("[%s %p] Connection error: %s", account.bare_jid.to_string(), stream, e.message);
change_connection_state(account, ConnectionState.DISCONNECTED);
connections[account].reset();
yield connections[account].reset();
StreamError.Flag? flag = stream.get_flag(StreamError.Flag.IDENTITY);
if (flag != null) {
@ -273,8 +273,10 @@ public class ConnectionManager : Object {
debug("[%s %p] Ping timeouted. Reconnecting", account.bare_jid.to_string(), stream);
change_connection_state(account, ConnectionState.DISCONNECTED);
connections[account].reset();
connect_stream.begin(account);
connections[account].reset.begin((_, res) => {
connections[account].reset.end(res);
connect_stream.begin(account);
});
return false;
});
}
@ -306,8 +308,10 @@ public class ConnectionManager : Object {
else {
change_connection_state(account, ConnectionState.DISCONNECTED);
connections[account].reset();
connect_stream.begin(account);
connections[account].reset.begin((_, res) => {
connections[account].reset.end(res);
connect_stream.begin(account);
});
}
}