summaryrefslogtreecommitdiff
path: root/internal/db/pg/pg.go
diff options
context:
space:
mode:
authorLibravatar Tobi Smethurst <31960611+tsmethurst@users.noreply.github.com>2021-06-19 11:18:55 +0200
committerLibravatar GitHub <noreply@github.com>2021-06-19 11:18:55 +0200
commitaa8a0d08501cbb22400a67ece85c45fdfbdc6131 (patch)
tree4a4581fb8f1c9bf8cac742be15d7a57eec170a1b /internal/db/pg/pg.go
parentupdate CONTRIBUTING with css bundling instructions, and go fmt (#48) (diff)
downloadgotosocial-aa8a0d08501cbb22400a67ece85c45fdfbdc6131.tar.xz
Streaming (#49)
Add new status and notification websocket streaming capabilities
Diffstat (limited to 'internal/db/pg/pg.go')
-rw-r--r--internal/db/pg/pg.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/internal/db/pg/pg.go b/internal/db/pg/pg.go
index 851501334..9daf94e31 100644
--- a/internal/db/pg/pg.go
+++ b/internal/db/pg/pg.go
@@ -810,7 +810,7 @@ func (ps *postgresService) Follows(sourceAccount *gtsmodel.Account, targetAccoun
if sourceAccount == nil || targetAccount == nil {
return false, nil
}
-
+
return ps.conn.Model(&gtsmodel.Follow{}).Where("account_id = ?", sourceAccount.ID).Where("target_account_id = ?", targetAccount.ID).Exists()
}
@@ -818,7 +818,7 @@ func (ps *postgresService) FollowRequested(sourceAccount *gtsmodel.Account, targ
if sourceAccount == nil || targetAccount == nil {
return false, nil
}
-
+
return ps.conn.Model(&gtsmodel.FollowRequest{}).Where("account_id = ?", sourceAccount.ID).Where("target_account_id = ?", targetAccount.ID).Exists()
}
@@ -826,7 +826,7 @@ func (ps *postgresService) Mutuals(account1 *gtsmodel.Account, account2 *gtsmode
if account1 == nil || account2 == nil {
return false, nil
}
-
+
// make sure account 1 follows account 2
f1, err := ps.conn.Model(&gtsmodel.Follow{}).Where("account_id = ?", account1.ID).Where("target_account_id = ?", account2.ID).Exists()
if err != nil {
@@ -975,6 +975,7 @@ func (ps *postgresService) GetPublicTimelineForAccount(accountID string, maxID s
q := ps.conn.Model(&statuses).
Where("visibility = ?", gtsmodel.VisibilityPublic).
Where("? IS NULL", pg.Ident("in_reply_to_id")).
+ Where("? IS NULL", pg.Ident("in_reply_to_uri")).
Where("? IS NULL", pg.Ident("boost_of_id")).
Order("status.id DESC")