From 1d8f957248c084773b235919be17d238be36ae01 Mon Sep 17 00:00:00 2001 From: FChannel <> Date: Sun, 3 Oct 2021 13:53:11 -0700 Subject: v0.0.15-dev --- static/faq.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/faq.html b/static/faq.html index f4fb237..06ae421 100644 --- a/static/faq.html +++ b/static/faq.html @@ -56,7 +56,7 @@

Soon™.

What version is this FChannel instance?

-

v0.0.14-release

+

v0.0.15-dev

[Home][Rules][FAQ] -- cgit v1.2.3 From 4802b91fe62eb28512b7f6c602d40f807bcbd33f Mon Sep 17 00:00:00 2001 From: FChannel <> Date: Mon, 4 Oct 2021 19:27:54 -0700 Subject: fix for instance index with empty actor id --- main.go | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/main.go b/main.go index 68d8a4f..8deedd4 100644 --- a/main.go +++ b/main.go @@ -2778,27 +2778,31 @@ func AddInstanceToIndex(actor string) { func AddInstanceToIndexDB(db *sql.DB, actor string) { + //sleep to be sure the webserver is fully initialized + //before making finger request time.Sleep(15 * time.Second) + nActor := FingerActor(actor) + + if nActor.Id == "" { + return + } + followers := GetCollectionFromID("https://fchan.xyz/followers") var alreadyIndex = false for _, e := range followers.Items { - if e.Id == actor { + if e.Id == nActor.Id { alreadyIndex = true } } - checkActor := GetActor(actor) - - if checkActor.Id == actor { - if !alreadyIndex { - query := `insert into follower (id, follower) values ($1, $2)` + if !alreadyIndex { + query := `insert into follower (id, follower) values ($1, $2)` - _, err := db.Exec(query, "https://fchan.xyz", actor) + _, err := db.Exec(query, "https://fchan.xyz", nActor.Id) - CheckError(err, "Error with add to index query") - } + CheckError(err, "Error with add to index query") } } -- cgit v1.2.3 From 1df965ee5a13921f30a453cd81be6def8f19c2b3 Mon Sep 17 00:00:00 2001 From: FChannel <> Date: Mon, 4 Oct 2021 19:47:46 -0700 Subject: fix for faking post IDs --- outboxPost.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/outboxPost.go b/outboxPost.go index cb48d3e..65b9929 100644 --- a/outboxPost.go +++ b/outboxPost.go @@ -537,14 +537,23 @@ func ParseInboxRequest(w http.ResponseWriter, r *http.Request, db *sql.DB) { switch activity.Type { case "Create": + for _, e := range activity.To { if IsActorLocal(db, e) { if !IsActorLocal(db, activity.Actor.Id) { + + col := GetCollectionFromID(activity.Object.Id) + + if len(col.OrderedItems) < 1 { + break + } + WriteObjectToCache(db, *activity.Object) ArchivePosts(db, GetActorFromDB(db, e)) } } } + break case "Delete": -- cgit v1.2.3 From 4e26c41df1c90ec5fe4a782d74a81f937b1015f2 Mon Sep 17 00:00:00 2001 From: FChannel <> Date: Mon, 4 Oct 2021 20:07:55 -0700 Subject: fix for reply box offset off screen --- static/bottom.html | 2 +- static/js/posts.js | 8 ++------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/static/bottom.html b/static/bottom.html index 023deeb..ab8d88d 100644 --- a/static/bottom.html +++ b/static/bottom.html @@ -4,7 +4,7 @@
- + diff --git a/static/js/posts.js b/static/js/posts.js index 29541c0..b9e9706 100644 --- a/static/js/posts.js +++ b/static/js/posts.js @@ -164,11 +164,7 @@ function quote(actorName, opid, id) var inReplyTo = document.getElementById("inReplyTo-box"); var w = window.innerWidth / 2 - 200; - if(id == "reply") { - var h = document.getElementById(id + "-content").offsetTop - 548; - } else { - var h = document.getElementById(id + "-content").offsetTop - 348; - } + var h = 300; //document.getElementById(id + "-content").offsetTop - 348; const boxStyle = "top: " + h + "px; left: " + w + "px;"; box.setAttribute("style", boxStyle); @@ -201,7 +197,7 @@ function report(actorName, id) var inReplyTo = document.getElementById("report-inReplyTo-box"); var w = window.innerWidth / 2 - 200; - var h = document.getElementById(id + "-content").offsetTop - 348; + var h = 300; //document.getElementById(id + "-content").offsetTop - 348; const boxStyle = "top: " + h + "px; left: " + w + "px;"; box.setAttribute("style", boxStyle); -- cgit v1.2.3 From 36c63daa85818488055edf8ae63af58058e4efb2 Mon Sep 17 00:00:00 2001 From: FChannel <> Date: Mon, 4 Oct 2021 20:10:11 -0700 Subject: fix for aref link slash to correct path --- client.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client.go b/client.go index dc3ed36..a8f4c9f 100644 --- a/client.go +++ b/client.go @@ -257,7 +257,7 @@ func OutboxGet(w http.ResponseWriter, r *http.Request, db *sql.DB, collection Co "parseReplyLink": func(actorId string, op string, id string, content string) template.HTML { actor := FingerActor(actorId) title := strings.ReplaceAll(ParseLinkTitle(actor.Id, op, content), `/\<`, ">") - link := ">>" + shortURL(actor.Outbox, id) + "" + link := ">>" + shortURL(actor.Outbox, id) + "" return template.HTML(link) }, "add": func(i, j int) int { -- cgit v1.2.3