aboutsummaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorFChannel <>2022-06-16 17:49:44 -0700
committerFChannel <>2022-06-19 12:53:29 -0700
commit54a0578dbc5eb65cd84ec1a67b2b36a4fbfb73ee (patch)
tree2dbdbc1869e197e03182054051202466ca9dd562 /db
parent6237c9ac3213d2efed516c56881474dcaa508935 (diff)
fix for routing to correct thread from child post
Diffstat (limited to 'db')
-rw-r--r--db/database.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/db/database.go b/db/database.go
index 46297ec..7f1149a 100644
--- a/db/database.go
+++ b/db/database.go
@@ -417,3 +417,17 @@ func InitInstance() error {
return nil
}
+
+func GetPostIDFromNum(num string) (string, error) {
+ var postID string
+
+ query := `select id from activitystream where id like $1`
+ if err := config.DB.QueryRow(query, "%"+num).Scan(&postID); err != nil {
+ query = `select id from cacheactivitystream where id like $1`
+ if err := config.DB.QueryRow(query, "%"+num).Scan(&postID); err != nil {
+ return "", util.MakeError(err, "GetPostIDFromNum")
+ }
+ }
+
+ return postID, nil
+}