I think this fixes the questionable archaic sequence / author order issue.

git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@3813 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
2022-02-03 02:00:05 +00:00
parent a98a848bb7
commit cd51edcd8f
6 changed files with 69 additions and 40 deletions

View File

@ -225,9 +225,10 @@ static JSValue _tf_ssb_storeMessage(JSContext* context, JSValueConst this_val, i
char signature[crypto_sign_BYTES + 128];
char id[crypto_hash_sha256_BYTES * 2 + 1];
tf_ssb_calculate_message_id(context, argv[0], id, sizeof(id));
if (tf_ssb_verify_and_strip_signature(context, argv[0], signature, sizeof(signature)))
bool sequence_before_author = false;
if (tf_ssb_verify_and_strip_signature(context, argv[0], signature, sizeof(signature), &sequence_before_author))
{
if (tf_ssb_db_store_message(ssb, context, id, argv[0], signature))
if (tf_ssb_db_store_message(ssb, context, id, argv[0], signature, sequence_before_author))
{
tf_ssb_notify_message_added(ssb, id);
}