[fix] fix join problem that when join to a server which does not exist in recent connections

This commit is contained in:
dijunkun
2025-04-10 17:35:21 +08:00
parent 5351b4da0e
commit 824d9243cc
2 changed files with 4 additions and 1 deletions

View File

@@ -130,6 +130,7 @@ int Render::ConnectionStatusWindow(
show_connection_status_window_ = true;
password_validating_ = true;
props->rejoin_ = true;
need_to_rejoin_ = true;
focus_on_input_widget_ = true;
}

View File

@@ -157,7 +157,9 @@ int Render::ConnectTo(const std::string &remote_id, const char *password,
auto props = client_properties_[remote_id];
if (!props->connection_established_) {
props->remember_password_ = remember_password;
memcpy(props->remote_password_, password, 6);
if (strcmp(password, "") != 0) {
memcpy(props->remote_password_, password, sizeof(password));
}
ret = JoinConnection(props->peer_, remote_id.c_str(), password);
if (0 == ret) {
props->rejoin_ = false;