From 727b5701327a7e1c5f826f496b8e99c2004e471a Mon Sep 17 00:00:00 2001 From: KushBlazingJudah <59340248+KushBlazingJudah@users.noreply.github.com> Date: Wed, 18 Aug 2021 17:34:12 -0300 Subject: experimental type change for times: string to time.Time idk what i was doing before this but i wanted to use time.Time to get something similar to how 4chan's timestamps work, it would've also been easier for scripts to interface with it, since we have data we can work with much easier than a string i am not sure what this means for federation yet, so i'll test it out before i do anything. --- database.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'database.go') diff --git a/database.go b/database.go index 0a99086..b0a5736 100644 --- a/database.go +++ b/database.go @@ -175,16 +175,16 @@ func WriteObjectToDB(db *sql.DB, obj ObjectBase) ObjectBase { if len(obj.Attachment) > 0 { if obj.Preview.Href != "" { obj.Preview.Id = fmt.Sprintf("%s/%s", obj.Actor, CreateUniqueID(db, obj.Actor)) - obj.Preview.Published = time.Now().UTC().Format(time.RFC3339) - obj.Preview.Updated = time.Now().UTC().Format(time.RFC3339) + obj.Preview.Published = time.Now().UTC() + obj.Preview.Updated = time.Now().UTC() obj.Preview.AttributedTo = obj.Id WritePreviewToDB(db, *obj.Preview) } for i, _ := range obj.Attachment { obj.Attachment[i].Id = fmt.Sprintf("%s/%s", obj.Actor, CreateUniqueID(db, obj.Actor)) - obj.Attachment[i].Published = time.Now().UTC().Format(time.RFC3339) - obj.Attachment[i].Updated = time.Now().UTC().Format(time.RFC3339) + obj.Attachment[i].Published = time.Now().UTC() + obj.Attachment[i].Updated = time.Now().UTC() obj.Attachment[i].AttributedTo = obj.Id WriteAttachmentToDB(db, obj.Attachment[i]) WriteActivitytoDBWithAttachment(db, obj, obj.Attachment[i], *obj.Preview) -- cgit v1.2.3