155 size_t out_previous_size,
double* out_timestamp,
char** out_content,
char* out_hash,
size_t out_hash_size,
char* out_signature,
size_t out_signature_size,
int* out_flags);
284 JSContext* context,
const char* previous,
const char* author, int32_t sequence,
double timestamp,
const char*
hash,
const char* content,
const char* signature,
int flags);
300 char id[k_id_base64_len];
571int tf_ssb_sqlite_authorizer(
void* user_data,
int action_code,
const char* arg0,
const char* arg1,
const char* arg2,
const char* arg3);
struct JSContext JSContext
Definition: api.js.h:10
struct uv_loop_s uv_loop_t
Definition: http.h:33
struct _tf_ssb_t tf_ssb_t
Definition: httpd.js.h:38
bool tf_ssb_db_user_has_permission(tf_ssb_t *ssb, sqlite3 *db, const char *id, const char *permission)
const char * tf_ssb_db_get_profile_name(sqlite3 *db, const char *id)
tf_ssb_following_t * tf_ssb_db_following_deep(tf_ssb_t *ssb, const char **ids, int count, int depth, bool include_blocks)
const char * tf_ssb_db_get_profile(sqlite3 *db, const char *id)
bool tf_ssb_db_remove_value_from_array_property(tf_ssb_t *ssb, const char *id, const char *key, const char *value)
struct _tf_ssb_identity_info_t tf_ssb_identity_info_t
bool tf_ssb_db_get_message_by_author_and_sequence(tf_ssb_t *ssb, const char *author, int32_t sequence, char *out_message_id, size_t out_message_id_size, char *out_previous, size_t out_previous_size, double *out_timestamp, char **out_content, char *out_hash, size_t out_hash_size, char *out_signature, size_t out_signature_size, int *out_flags)
bool tf_ssb_db_use_invite(sqlite3 *db, const char *id)
tf_ssb_db_stored_connection_t * tf_ssb_db_get_stored_connections(tf_ssb_t *ssb, int *out_count)
void tf_ssb_db_forget_stored_connection(tf_ssb_t *ssb, const char *address, int port, const char *pubkey)
void tf_ssb_db_identity_visit(tf_ssb_t *ssb, const char *user, void(*callback)(const char *identity, void *user_data), void *user_data)
JSValue tf_ssb_db_visit_query(tf_ssb_t *ssb, const char *query, const JSValue binds, void(*callback)(JSValue row, void *user_data), void *user_data)
bool tf_ssb_db_message_content_get(tf_ssb_t *ssb, const char *id, uint8_t **out_blob, size_t *out_size)
bool tf_ssb_db_get_account_password_hash(tf_ssb_t *ssb, const char *name, char *out_password, size_t password_size)
bool tf_ssb_db_identity_add(tf_ssb_t *ssb, const char *user, const char *public_key, const char *private_key)
void tf_ssb_db_store_message(tf_ssb_t *ssb, JSContext *context, const char *id, JSValue val, const char *signature, int flags, tf_ssb_db_store_message_callback_t *callback, void *user_data)
void tf_ssb_db_blob_store_async(tf_ssb_t *ssb, const uint8_t *blob, size_t size, tf_ssb_db_blob_store_callback_t *callback, void *user_data)
int tf_ssb_db_identity_get_count_for_user(tf_ssb_t *ssb, const char *user)
const char ** tf_ssb_db_get_all_visible_identities(tf_ssb_t *ssb, int depth)
bool tf_ssb_db_generate_invite(sqlite3 *db, const char *id, const char *host, int port, int use_count, int expires_seconds, char *out_invite, size_t size)
bool tf_ssb_db_remove_property(tf_ssb_t *ssb, const char *id, const char *key)
bool tf_ssb_db_blob_get(tf_ssb_t *ssb, const char *id, uint8_t **out_blob, size_t *out_size)
const char ** tf_ssb_db_following_deep_ids(tf_ssb_t *ssb, const char **ids, int count, int depth)
void tf_ssb_db_identity_visit_all(tf_ssb_t *ssb, void(*callback)(const char *identity, void *user_data), void *user_data)
void() tf_ssb_db_store_message_callback_t(const char *id, bool stored, void *user_data)
Definition: ssb.db.h:82
void tf_ssb_db_init(tf_ssb_t *ssb)
void tf_ssb_db_init_reader(sqlite3 *db)
void tf_ssb_db_resolve_index_async(tf_ssb_t *ssb, const char *host, void(*callback)(const char *path, void *user_data), void *user_data)
bool tf_ssb_db_blob_has(sqlite3 *db, const char *id)
bool tf_ssb_db_check(sqlite3 *db, const char *author)
int tf_ssb_sqlite_authorizer(void *user_data, int action_code, const char *arg0, const char *arg1, const char *arg2, const char *arg3)
bool tf_ssb_db_set_global_setting_from_string(sqlite3 *db, const char *name, char *value)
bool tf_ssb_db_get_latest_message_by_author(tf_ssb_t *ssb, const char *author, int32_t *out_sequence, char *out_message_id, size_t out_message_id_size)
void() tf_ssb_db_blob_get_callback_t(bool found, const uint8_t *data, size_t size, void *user_data)
Definition: ssb.db.h:65
bool tf_ssb_db_has_invite(sqlite3 *db, const char *id)
tf_ssb_identity_info_t * tf_ssb_db_get_identity_info(tf_ssb_t *ssb, const char *user, const char *package_owner, const char *package_name)
const char * tf_ssb_db_get_user_for_identity(tf_ssb_t *ssb, const char *public_key)
bool tf_ssb_db_set_property(tf_ssb_t *ssb, const char *id, const char *key, const char *value)
bool tf_ssb_db_verify(tf_ssb_t *ssb, const char *id, int32_t debug_sequence, bool fix)
JSValue tf_ssb_format_message(JSContext *context, const char *previous, const char *author, int32_t sequence, double timestamp, const char *hash, const char *content, const char *signature, int flags)
struct _tf_ssb_following_t tf_ssb_following_t
bool tf_ssb_db_add_value_to_array_property(tf_ssb_t *ssb, const char *id, const char *key, const char *value)
JSValue tf_ssb_db_get_message_by_id(tf_ssb_t *ssb, const char *id, bool is_keys)
bool tf_ssb_db_identity_get_private_key(tf_ssb_t *ssb, const char *user, const char *public_key, uint8_t *out_private_key, size_t private_key_size)
bool tf_ssb_db_set_account_password(uv_loop_t *loop, sqlite3 *db, JSContext *context, const char *name, const char *password)
void tf_ssb_db_add_blob_wants(sqlite3 *db, const char *id)
bool tf_ssb_db_blob_store(tf_ssb_t *ssb, const uint8_t *blob, size_t size, char *out_id, size_t out_id_size, bool *out_new)
void() tf_ssb_db_blob_store_callback_t(const char *id, bool is_new, void *user_data)
Definition: ssb.db.h:104
bool tf_ssb_db_is_account_familiar(sqlite3 *db, const char *id, int depth)
bool tf_ssb_db_register_account(uv_loop_t *loop, sqlite3 *db, JSContext *context, const char *name, const char *password)
bool tf_ssb_db_identity_create(tf_ssb_t *ssb, const char *user, uint8_t *out_public_key, uint8_t *out_private_key)
bool tf_ssb_db_get_global_setting_int64(sqlite3 *db, const char *name, int64_t *out_value)
bool tf_ssb_db_get_global_setting_string(sqlite3 *db, const char *name, char *out_value, size_t size)
struct _tf_ssb_db_stored_connection_t tf_ssb_db_stored_connection_t
void tf_ssb_db_blob_get_async(tf_ssb_t *ssb, const char *id, tf_ssb_db_blob_get_callback_t *callback, void *user_data)
bool tf_ssb_db_identity_delete(tf_ssb_t *ssb, const char *user, const char *public_key)
bool tf_ssb_db_get_global_setting_bool(sqlite3 *db, const char *name, bool *out_value)
bool tf_ssb_db_identity_get_active(sqlite3 *db, const char *user, const char *package_owner, const char *package_name, char *out_identity, size_t out_identity_size)
const char * tf_ssb_db_get_property(tf_ssb_t *ssb, const char *id, const char *key)
struct sqlite3 sqlite3
Definition: ssb.h:97
function hash()
Definition: client.js:1161
char address[256]
Definition: ssb.db.h:338
char pubkey[k_id_base64_len]
Definition: ssb.db.h:342
int port
Definition: ssb.db.h:340
int64_t last_success
Definition: ssb.db.h:346
int64_t last_attempt
Definition: ssb.db.h:344
int depth
Definition: ssb.db.h:298
int followed_by_count
Definition: ssb.db.h:294
int blocking_count
Definition: ssb.db.h:292
int blocked_by_count
Definition: ssb.db.h:296
int following_count
Definition: ssb.db.h:290
char active_identity[k_id_base64_len]
Definition: ssb.db.h:593
int count
Definition: ssb.db.h:591
const char ** identity
Definition: ssb.db.h:587
const char ** name
Definition: ssb.db.h:589