ssb: Before destroying a connection, show a message on why it is going away in the UI.
All checks were successful
Build Tilde Friends / Build-All (push) Successful in 20m6s

This commit is contained in:
2024-12-24 17:23:22 -05:00
parent c85dd2655c
commit 855f5f7af4
5 changed files with 58 additions and 12 deletions

View File

@ -1120,6 +1120,11 @@ static JSValue _tf_ssb_connections(JSContext* context, JSValueConst this_val, in
int flags = tf_ssb_connection_get_flags(connection);
JS_SetPropertyStr(context, flags_object, "one_shot", JS_NewBool(context, (flags & k_tf_ssb_connect_flag_one_shot) != 0));
JS_SetPropertyStr(context, object, "flags", flags_object);
const char* destroy_reason = tf_ssb_connection_get_destroy_reason(connection);
if (destroy_reason)
{
JS_SetPropertyStr(context, object, "destroy_reason", JS_NewString(context, destroy_reason));
}
JS_SetPropertyUint32(context, result, i, object);
}
}