ssb: Sync on demand fixes. Avoid keeping message streams live in this mode.
All checks were successful
Build Tilde Friends / Build-All (push) Successful in 19m17s

This commit is contained in:
2024-10-06 11:50:49 -04:00
parent 8a6147d512
commit 85fce59c0c
4 changed files with 22 additions and 7 deletions

View File

@ -309,7 +309,7 @@ static void _tf_ssb_connections_get_all_work(tf_ssb_t* ssb, void* user_data)
int port = sqlite3_column_int(statement, 1);
const char* key = (const char*)sqlite3_column_text(statement, 2);
char connection[1024] = { 0 };
snprintf(connection, sizeof(connection), "net:%s:%d~shs:%s", host, port, key);
snprintf(connection, sizeof(connection), "net:%s:%d~shs:%s", host, port, *key == '@' ? key + 1 : key);
char* dot = strrchr(connection, '.');
if (dot && strcmp(dot, ".ed25519") == 0)
{
@ -332,7 +332,6 @@ static void _tf_ssb_connections_get_all_after_work(tf_ssb_t* ssb, int status, vo
tf_ssb_connections_get_all_work_t* work = user_data;
for (int i = 0; i < work->connections_count; i++)
{
tf_printf("connections[%d] = %s\n", i, work->connections[i]);
tf_ssb_connect_str(ssb, work->connections[i], k_tf_ssb_connect_flag_one_shot);
tf_free(work->connections[i]);
}