ssb: Respond to tunnel.endpoints. Patchwork didn't seem to like that we responded to tunnel.isRoom but not this.
All checks were successful
Build Tilde Friends / Build-All (push) Successful in 28m4s

This commit is contained in:
2025-01-11 09:23:12 -05:00
parent 872201c886
commit e59a00922b
3 changed files with 101 additions and 0 deletions

View File

@ -294,6 +294,8 @@ typedef struct _tf_ssb_connection_t
tf_ssb_state_t state;
bool is_attendant;
int32_t attendant_request_number;
bool is_endpoint;
int32_t endpoint_request_number;
uint8_t epub[crypto_box_PUBLICKEYBYTES];
uint8_t epriv[crypto_box_SECRETKEYBYTES];
@ -942,6 +944,7 @@ bool tf_ssb_connection_rpc_send_error_method_not_allowed(tf_ssb_connection_t* co
{
char buffer[1024] = "";
snprintf(buffer, sizeof(buffer), "method '%s' is not in list of allowed methods", name);
tf_printf("%s\n", buffer);
return tf_ssb_connection_rpc_send_error(connection, flags, request_number, buffer);
}
@ -3857,6 +3860,23 @@ void tf_ssb_connection_set_attendant(tf_ssb_connection_t* connection, bool atten
_tf_ssb_notify_broadcasts_changed(connection->ssb);
}
void tf_ssb_connection_set_endpoint(tf_ssb_connection_t* connection, bool endpoint, int request_number)
{
connection->is_endpoint = endpoint;
connection->endpoint_request_number = request_number;
_tf_ssb_notify_broadcasts_changed(connection->ssb);
}
bool tf_ssb_connection_is_endpoint(tf_ssb_connection_t* connection)
{
return connection->is_endpoint;
}
int32_t tf_ssb_connection_get_endpoint_request_number(tf_ssb_connection_t* connection)
{
return connection->endpoint_request_number;
}
void tf_ssb_connection_clear_room_attendants(tf_ssb_connection_t* connection)
{
int modified = 0;