mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-11-28 14:53:33 -06:00
[feature] Receive notification when followed account posts (if desired) (#1680)
* start working on notifs for new posts * tidy up a bit * update swagger * carry over show reblogs + notify from follow req * test notify on status post * update column slice * dedupe update logic + add tests * fix own boosts not being timelined * avoid type check, passing unnecessary accounts * remove unnecessary 'inReplyToID' check * add a couple todo's for future db functions
This commit is contained in:
parent
c01d2f9b44
commit
093cf2ab12
17 changed files with 788 additions and 448 deletions
|
|
@ -28,6 +28,7 @@ import (
|
|||
"github.com/superseriousbusiness/gotosocial/internal/db"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/gtsmodel"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/id"
|
||||
"github.com/superseriousbusiness/gotosocial/testrig"
|
||||
)
|
||||
|
||||
type RelationshipTestSuite struct {
|
||||
|
|
@ -861,6 +862,32 @@ func (suite *RelationshipTestSuite) TestUnfollowRequestNotExisting() {
|
|||
suite.Nil(followRequest)
|
||||
}
|
||||
|
||||
func (suite *RelationshipTestSuite) TestUpdateFollow() {
|
||||
ctx := context.Background()
|
||||
|
||||
follow := >smodel.Follow{}
|
||||
*follow = *suite.testFollows["local_account_1_admin_account"]
|
||||
|
||||
follow.Notify = testrig.TrueBool()
|
||||
if err := suite.db.UpdateFollow(ctx, follow, "notify"); err != nil {
|
||||
suite.FailNow(err.Error())
|
||||
}
|
||||
|
||||
dbFollow, err := suite.db.GetFollowByID(ctx, follow.ID)
|
||||
if err != nil {
|
||||
suite.FailNow(err.Error())
|
||||
}
|
||||
|
||||
suite.True(*dbFollow.Notify)
|
||||
|
||||
relationship, err := suite.db.GetRelationship(ctx, follow.AccountID, follow.TargetAccountID)
|
||||
if err != nil {
|
||||
suite.FailNow(err.Error())
|
||||
}
|
||||
|
||||
suite.True(relationship.Notifying)
|
||||
}
|
||||
|
||||
func TestRelationshipTestSuite(t *testing.T) {
|
||||
suite.Run(t, new(RelationshipTestSuite))
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue