mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-29 07:12:25 -05:00
[chore] Add interaction policy gtsmodels (#3075)
* [chore] introduce interaction policy gts models * update migration a smidge * fix copy paste typo * update migration * use int for InteractionType
This commit is contained in:
parent
8f8093aea4
commit
5bc567196b
46 changed files with 1318 additions and 531 deletions
|
|
@ -1401,9 +1401,6 @@ func NewTestStatuses() map[string]*gtsmodel.Status {
|
|||
Language: "en",
|
||||
CreatedWithApplicationID: "01F8MGXQRHYF5QPMTMXP78QC2F",
|
||||
Federated: util.Ptr(true),
|
||||
Boostable: util.Ptr(true),
|
||||
Replyable: util.Ptr(true),
|
||||
Likeable: util.Ptr(true),
|
||||
ActivityStreamsType: ap.ObjectNote,
|
||||
},
|
||||
"admin_account_status_2": {
|
||||
|
|
@ -1427,9 +1424,6 @@ func NewTestStatuses() map[string]*gtsmodel.Status {
|
|||
Language: "en",
|
||||
CreatedWithApplicationID: "01F8MGXQRHYF5QPMTMXP78QC2F",
|
||||
Federated: util.Ptr(true),
|
||||
Boostable: util.Ptr(true),
|
||||
Replyable: util.Ptr(true),
|
||||
Likeable: util.Ptr(true),
|
||||
ActivityStreamsType: ap.ObjectNote,
|
||||
},
|
||||
"admin_account_status_3": {
|
||||
|
|
@ -1454,9 +1448,6 @@ func NewTestStatuses() map[string]*gtsmodel.Status {
|
|||
Language: "en",
|
||||
CreatedWithApplicationID: "01F8MGXQRHYF5QPMTMXP78QC2F",
|
||||
Federated: util.Ptr(true),
|
||||
Boostable: util.Ptr(true),
|
||||
Replyable: util.Ptr(true),
|
||||
Likeable: util.Ptr(true),
|
||||
ActivityStreamsType: ap.ObjectNote,
|
||||
},
|
||||
"admin_account_status_4": {
|
||||
|
|
@ -1482,9 +1473,6 @@ func NewTestStatuses() map[string]*gtsmodel.Status {
|
|||
Language: "en",
|
||||
CreatedWithApplicationID: "01F8MGXQRHYF5QPMTMXP78QC2F",
|
||||
Federated: util.Ptr(true),
|
||||
Boostable: util.Ptr(true),
|
||||
Replyable: util.Ptr(true),
|
||||
Likeable: util.Ptr(true),
|
||||
ActivityStreamsType: ap.ObjectNote,
|
||||
},
|
||||
"local_account_1_status_1": {
|
||||
|
|
@ -1507,9 +1495,6 @@ func NewTestStatuses() map[string]*gtsmodel.Status {
|
|||
Language: "en",
|
||||
CreatedWithApplicationID: "01F8MGY43H3N2C8EWPR2FPYEXG",
|
||||
Federated: util.Ptr(true),
|
||||
Boostable: util.Ptr(true),
|
||||
Replyable: util.Ptr(true),
|
||||
Likeable: util.Ptr(true),
|
||||
ActivityStreamsType: ap.ObjectNote,
|
||||
},
|
||||
"local_account_1_status_2": {
|
||||
|
|
@ -1532,9 +1517,6 @@ func NewTestStatuses() map[string]*gtsmodel.Status {
|
|||
Language: "en",
|
||||
CreatedWithApplicationID: "01F8MGY43H3N2C8EWPR2FPYEXG",
|
||||
Federated: util.Ptr(false),
|
||||
Boostable: util.Ptr(true),
|
||||
Replyable: util.Ptr(true),
|
||||
Likeable: util.Ptr(true),
|
||||
ActivityStreamsType: ap.ObjectNote,
|
||||
},
|
||||
"local_account_1_status_3": {
|
||||
|
|
@ -1557,10 +1539,18 @@ func NewTestStatuses() map[string]*gtsmodel.Status {
|
|||
Language: "en",
|
||||
CreatedWithApplicationID: "01F8MGY43H3N2C8EWPR2FPYEXG",
|
||||
Federated: util.Ptr(true),
|
||||
Boostable: util.Ptr(false),
|
||||
Replyable: util.Ptr(false),
|
||||
Likeable: util.Ptr(false),
|
||||
ActivityStreamsType: ap.ObjectNote,
|
||||
InteractionPolicy: >smodel.InteractionPolicy{
|
||||
CanLike: gtsmodel.PolicyRules{
|
||||
Always: gtsmodel.PolicyValues{gtsmodel.PolicyValueAuthor},
|
||||
},
|
||||
CanReply: gtsmodel.PolicyRules{
|
||||
Always: gtsmodel.PolicyValues{gtsmodel.PolicyValueAuthor},
|
||||
},
|
||||
CanAnnounce: gtsmodel.PolicyRules{
|
||||
Always: gtsmodel.PolicyValues{gtsmodel.PolicyValueAuthor},
|
||||
},
|
||||
},
|
||||
ActivityStreamsType: ap.ObjectNote,
|
||||
},
|
||||
"local_account_1_status_4": {
|
||||
ID: "01F8MH82FYRXD2RC6108DAJ5HB",
|
||||
|
|
@ -1583,9 +1573,6 @@ func NewTestStatuses() map[string]*gtsmodel.Status {
|
|||
Language: "en",
|
||||
CreatedWithApplicationID: "01F8MGY43H3N2C8EWPR2FPYEXG",
|
||||
Federated: util.Ptr(true),
|
||||
Boostable: util.Ptr(true),
|
||||
Replyable: util.Ptr(true),
|
||||
Likeable: util.Ptr(true),
|
||||
ActivityStreamsType: ap.ObjectNote,
|
||||
},
|
||||
"local_account_1_status_5": {
|
||||
|
|
@ -1609,9 +1596,6 @@ func NewTestStatuses() map[string]*gtsmodel.Status {
|
|||
Language: "en",
|
||||
CreatedWithApplicationID: "01F8MGY43H3N2C8EWPR2FPYEXG",
|
||||
Federated: util.Ptr(true),
|
||||
Boostable: util.Ptr(true),
|
||||
Replyable: util.Ptr(true),
|
||||
Likeable: util.Ptr(true),
|
||||
ActivityStreamsType: ap.ObjectNote,
|
||||
},
|
||||
"local_account_1_status_6": {
|
||||
|
|
@ -1635,9 +1619,6 @@ func NewTestStatuses() map[string]*gtsmodel.Status {
|
|||
Language: "en",
|
||||
CreatedWithApplicationID: "01F8MGY43H3N2C8EWPR2FPYEXG",
|
||||
Federated: util.Ptr(true),
|
||||
Boostable: util.Ptr(true),
|
||||
Replyable: util.Ptr(true),
|
||||
Likeable: util.Ptr(true),
|
||||
ActivityStreamsType: ap.ActivityQuestion,
|
||||
PollID: "01HEN2RKT1YTEZ80SA8HGP105F",
|
||||
},
|
||||
|
|
@ -1661,9 +1642,6 @@ func NewTestStatuses() map[string]*gtsmodel.Status {
|
|||
Language: "en",
|
||||
CreatedWithApplicationID: "01F8MGY43H3N2C8EWPR2FPYEXG",
|
||||
Federated: util.Ptr(true),
|
||||
Boostable: util.Ptr(true),
|
||||
Replyable: util.Ptr(true),
|
||||
Likeable: util.Ptr(true),
|
||||
ActivityStreamsType: ap.ObjectNote,
|
||||
},
|
||||
"local_account_2_status_1": {
|
||||
|
|
@ -1686,9 +1664,6 @@ func NewTestStatuses() map[string]*gtsmodel.Status {
|
|||
Language: "en",
|
||||
CreatedWithApplicationID: "01F8MGYG9E893WRHW0TAEXR8GJ",
|
||||
Federated: util.Ptr(true),
|
||||
Boostable: util.Ptr(true),
|
||||
Replyable: util.Ptr(true),
|
||||
Likeable: util.Ptr(true),
|
||||
ActivityStreamsType: ap.ObjectNote,
|
||||
},
|
||||
"local_account_2_status_2": {
|
||||
|
|
@ -1711,17 +1686,25 @@ func NewTestStatuses() map[string]*gtsmodel.Status {
|
|||
Language: "en",
|
||||
CreatedWithApplicationID: "01F8MGYG9E893WRHW0TAEXR8GJ",
|
||||
Federated: util.Ptr(true),
|
||||
Boostable: util.Ptr(true),
|
||||
Replyable: util.Ptr(false),
|
||||
Likeable: util.Ptr(true),
|
||||
ActivityStreamsType: ap.ObjectNote,
|
||||
InteractionPolicy: >smodel.InteractionPolicy{
|
||||
CanLike: gtsmodel.PolicyRules{
|
||||
Always: gtsmodel.PolicyValues{gtsmodel.PolicyValuePublic},
|
||||
},
|
||||
CanReply: gtsmodel.PolicyRules{
|
||||
Always: gtsmodel.PolicyValues{gtsmodel.PolicyValueAuthor},
|
||||
},
|
||||
CanAnnounce: gtsmodel.PolicyRules{
|
||||
Always: gtsmodel.PolicyValues{gtsmodel.PolicyValuePublic},
|
||||
},
|
||||
},
|
||||
ActivityStreamsType: ap.ObjectNote,
|
||||
},
|
||||
"local_account_2_status_3": {
|
||||
ID: "01F8MHC8VWDRBQR0N1BATDDEM5",
|
||||
URI: "http://localhost:8080/users/1happyturtle/statuses/01F8MHC8VWDRBQR0N1BATDDEM5",
|
||||
URL: "http://localhost:8080/@1happyturtle/statuses/01F8MHC8VWDRBQR0N1BATDDEM5",
|
||||
Content: "🐢 i don't mind people sharing this one but I don't want likes or replies to it because cba🐢",
|
||||
Text: "🐢 i don't mind people sharing this one but I don't want likes or replies to it because cba🐢",
|
||||
Content: "🐢 i don't mind people sharing and liking this one but I want to moderate replies to it 🐢",
|
||||
Text: "🐢 i don't mind people sharing and liking this one but I want to moderate replies to it 🐢",
|
||||
CreatedAt: TimeMustParse("2021-10-20T12:40:37+02:00"),
|
||||
UpdatedAt: TimeMustParse("2021-10-20T12:40:37+02:00"),
|
||||
Local: util.Ptr(true),
|
||||
|
|
@ -1730,16 +1713,25 @@ func NewTestStatuses() map[string]*gtsmodel.Status {
|
|||
InReplyToID: "",
|
||||
BoostOfID: "",
|
||||
ThreadID: "01HCWE4P0EW9HBA5WHW97D5YV0",
|
||||
ContentWarning: "you won't be able to like or reply to this",
|
||||
ContentWarning: "you won't be able to reply to this without my approval",
|
||||
Visibility: gtsmodel.VisibilityUnlocked,
|
||||
Sensitive: util.Ptr(true),
|
||||
Language: "en",
|
||||
CreatedWithApplicationID: "01F8MGYG9E893WRHW0TAEXR8GJ",
|
||||
Federated: util.Ptr(true),
|
||||
Boostable: util.Ptr(true),
|
||||
Replyable: util.Ptr(false),
|
||||
Likeable: util.Ptr(false),
|
||||
ActivityStreamsType: ap.ObjectNote,
|
||||
InteractionPolicy: >smodel.InteractionPolicy{
|
||||
CanLike: gtsmodel.PolicyRules{
|
||||
Always: gtsmodel.PolicyValues{gtsmodel.PolicyValuePublic},
|
||||
},
|
||||
CanReply: gtsmodel.PolicyRules{
|
||||
Always: gtsmodel.PolicyValues{gtsmodel.PolicyValueAuthor},
|
||||
WithApproval: gtsmodel.PolicyValues{gtsmodel.PolicyValuePublic},
|
||||
},
|
||||
CanAnnounce: gtsmodel.PolicyRules{
|
||||
Always: gtsmodel.PolicyValues{gtsmodel.PolicyValuePublic},
|
||||
},
|
||||
},
|
||||
ActivityStreamsType: ap.ObjectNote,
|
||||
},
|
||||
"local_account_2_status_4": {
|
||||
ID: "01F8MHCP5P2NWYQ416SBA0XSEV",
|
||||
|
|
@ -1761,10 +1753,17 @@ func NewTestStatuses() map[string]*gtsmodel.Status {
|
|||
Language: "en",
|
||||
CreatedWithApplicationID: "01F8MGYG9E893WRHW0TAEXR8GJ",
|
||||
Federated: util.Ptr(false),
|
||||
Boostable: util.Ptr(false),
|
||||
Replyable: util.Ptr(true),
|
||||
Likeable: util.Ptr(true),
|
||||
|
||||
InteractionPolicy: >smodel.InteractionPolicy{
|
||||
CanLike: gtsmodel.PolicyRules{
|
||||
Always: gtsmodel.PolicyValues{gtsmodel.PolicyValuePublic},
|
||||
},
|
||||
CanReply: gtsmodel.PolicyRules{
|
||||
Always: gtsmodel.PolicyValues{gtsmodel.PolicyValuePublic},
|
||||
},
|
||||
CanAnnounce: gtsmodel.PolicyRules{
|
||||
Always: gtsmodel.PolicyValues{gtsmodel.PolicyValueAuthor},
|
||||
},
|
||||
},
|
||||
ActivityStreamsType: ap.ObjectNote,
|
||||
},
|
||||
"local_account_2_status_5": {
|
||||
|
|
@ -1790,9 +1789,6 @@ func NewTestStatuses() map[string]*gtsmodel.Status {
|
|||
Language: "en",
|
||||
CreatedWithApplicationID: "01F8MGYG9E893WRHW0TAEXR8GJ",
|
||||
Federated: util.Ptr(true),
|
||||
Boostable: util.Ptr(true),
|
||||
Replyable: util.Ptr(true),
|
||||
Likeable: util.Ptr(true),
|
||||
ActivityStreamsType: ap.ObjectNote,
|
||||
},
|
||||
"local_account_2_status_6": {
|
||||
|
|
@ -1818,9 +1814,6 @@ func NewTestStatuses() map[string]*gtsmodel.Status {
|
|||
Language: "en",
|
||||
CreatedWithApplicationID: "01F8MGYG9E893WRHW0TAEXR8GJ",
|
||||
Federated: util.Ptr(true),
|
||||
Boostable: util.Ptr(true),
|
||||
Replyable: util.Ptr(true),
|
||||
Likeable: util.Ptr(true),
|
||||
ActivityStreamsType: ap.ObjectNote,
|
||||
},
|
||||
"local_account_2_status_7": {
|
||||
|
|
@ -1845,9 +1838,6 @@ func NewTestStatuses() map[string]*gtsmodel.Status {
|
|||
Language: "en",
|
||||
CreatedWithApplicationID: "01F8MGYG9E893WRHW0TAEXR8GJ",
|
||||
Federated: util.Ptr(true),
|
||||
Boostable: util.Ptr(true),
|
||||
Replyable: util.Ptr(true),
|
||||
Likeable: util.Ptr(true),
|
||||
ActivityStreamsType: ap.ObjectNote,
|
||||
},
|
||||
"local_account_2_status_8": {
|
||||
|
|
@ -1871,9 +1861,6 @@ func NewTestStatuses() map[string]*gtsmodel.Status {
|
|||
Language: "en",
|
||||
CreatedWithApplicationID: "01F8MGYG9E893WRHW0TAEXR8GJ",
|
||||
Federated: util.Ptr(true),
|
||||
Boostable: util.Ptr(true),
|
||||
Replyable: util.Ptr(true),
|
||||
Likeable: util.Ptr(true),
|
||||
ActivityStreamsType: ap.ActivityQuestion,
|
||||
PollID: "01HEN2QB5NR4NCEHGYC3HN84K6",
|
||||
},
|
||||
|
|
@ -1899,9 +1886,6 @@ func NewTestStatuses() map[string]*gtsmodel.Status {
|
|||
Language: "en",
|
||||
CreatedWithApplicationID: "",
|
||||
Federated: util.Ptr(true),
|
||||
Boostable: util.Ptr(true),
|
||||
Replyable: util.Ptr(true),
|
||||
Likeable: util.Ptr(true),
|
||||
ActivityStreamsType: ap.ObjectNote,
|
||||
},
|
||||
"remote_account_1_status_2": {
|
||||
|
|
@ -1925,9 +1909,6 @@ func NewTestStatuses() map[string]*gtsmodel.Status {
|
|||
Language: "en",
|
||||
CreatedWithApplicationID: "",
|
||||
Federated: util.Ptr(true),
|
||||
Boostable: util.Ptr(true),
|
||||
Replyable: util.Ptr(true),
|
||||
Likeable: util.Ptr(true),
|
||||
ActivityStreamsType: ap.ActivityQuestion,
|
||||
PollID: "01HEN2R65468ZG657C4ZPHJ4EX",
|
||||
},
|
||||
|
|
@ -1952,9 +1933,6 @@ func NewTestStatuses() map[string]*gtsmodel.Status {
|
|||
Language: "en",
|
||||
CreatedWithApplicationID: "",
|
||||
Federated: util.Ptr(true),
|
||||
Boostable: util.Ptr(true),
|
||||
Replyable: util.Ptr(true),
|
||||
Likeable: util.Ptr(true),
|
||||
ActivityStreamsType: ap.ActivityQuestion,
|
||||
PollID: "01HEWV1GW2D49R919NPEDXPTZ5",
|
||||
},
|
||||
|
|
@ -1980,9 +1958,6 @@ func NewTestStatuses() map[string]*gtsmodel.Status {
|
|||
Language: "en",
|
||||
CreatedWithApplicationID: "",
|
||||
Federated: util.Ptr(true),
|
||||
Boostable: util.Ptr(true),
|
||||
Replyable: util.Ptr(true),
|
||||
Likeable: util.Ptr(true),
|
||||
ActivityStreamsType: ap.ObjectNote,
|
||||
},
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue