forked from cory/tildefriends
ssb: sequence: Sequential 32-bit integer starting at 1.
This commit is contained in:
@ -1917,10 +1917,10 @@ static bool _tf_ssb_connection_box_stream_recv(tf_ssb_connection_t* connection)
|
||||
return true;
|
||||
}
|
||||
|
||||
JSValue tf_ssb_sign_message(tf_ssb_t* ssb, const char* author, const uint8_t* private_key, JSValue message, const char* previous_id, int64_t previous_sequence)
|
||||
JSValue tf_ssb_sign_message(tf_ssb_t* ssb, const char* author, const uint8_t* private_key, JSValue message, const char* previous_id, int32_t previous_sequence)
|
||||
{
|
||||
char actual_previous_id[crypto_hash_sha256_BYTES * 2];
|
||||
int64_t actual_previous_sequence = 0;
|
||||
int32_t actual_previous_sequence = 0;
|
||||
bool have_previous = false;
|
||||
if (previous_id)
|
||||
{
|
||||
@ -1938,7 +1938,7 @@ JSValue tf_ssb_sign_message(tf_ssb_t* ssb, const char* author, const uint8_t* pr
|
||||
|
||||
JS_SetPropertyStr(context, root, "previous", have_previous ? JS_NewString(context, actual_previous_id) : JS_NULL);
|
||||
JS_SetPropertyStr(context, root, "author", JS_NewString(context, author));
|
||||
JS_SetPropertyStr(context, root, "sequence", JS_NewInt64(context, actual_previous_sequence + 1));
|
||||
JS_SetPropertyStr(context, root, "sequence", JS_NewInt32(context, actual_previous_sequence + 1));
|
||||
|
||||
int64_t now = (int64_t)time(NULL);
|
||||
JS_SetPropertyStr(context, root, "timestamp", JS_NewInt64(context, now * 1000LL));
|
||||
@ -3923,7 +3923,7 @@ void tf_ssb_notify_blob_stored(tf_ssb_t* ssb, const char* id)
|
||||
ssb->blobs_stored++;
|
||||
}
|
||||
|
||||
void tf_ssb_notify_message_added(tf_ssb_t* ssb, const char* author, int64_t sequence, const char* id, JSValue message_keys)
|
||||
void tf_ssb_notify_message_added(tf_ssb_t* ssb, const char* author, int32_t sequence, const char* id, JSValue message_keys)
|
||||
{
|
||||
tf_ssb_message_added_callback_node_t* next = NULL;
|
||||
ssb->messages_stored++;
|
||||
|
Reference in New Issue
Block a user