I guess we support sub-millisecond timestamps. Who knew?

git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@3835 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
2022-02-12 01:44:11 +00:00
parent 50bef73200
commit 483638a7e6
3 changed files with 76 additions and 36 deletions

View File

@ -41,12 +41,12 @@ static JSValue _tf_ssb_getMessage(JSContext* context, JSValueConst this_val, int
const char* id = JS_ToCString(context, argv[0]);
int64_t sequence = 0;
JS_ToInt64(context, &sequence, argv[1]);
int64_t timestamp = -1;
double timestamp = -1.0;
char* contents = NULL;
if (tf_ssb_db_get_message_by_author_and_sequence(ssb, id, sequence, NULL, 0, &timestamp, &contents))
{
result = JS_NewObject(context);
JS_SetPropertyStr(context, result, "timestamp", JS_NewInt64(context, timestamp));
JS_SetPropertyStr(context, result, "timestamp", JS_NewFloat64(context, timestamp));
JS_SetPropertyStr(context, result, "content", JS_NewString(context, contents));
free(contents);
}