aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/account/account.ts
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2017-11-24 13:41:10 +0100
committerChocobozzz <florian.bigard@gmail.com>2017-11-27 19:40:53 +0100
commit63c93323ecdeaa4b6183d75dd3f13469e1ef3ebd (patch)
tree3ee4b351025d4b19f6e880754df44fa7605b683d /server/models/account/account.ts
parentd4f1e94c89336255537b0b82913591f00e716201 (diff)
downloadPeerTube-63c93323ecdeaa4b6183d75dd3f13469e1ef3ebd.tar.gz
PeerTube-63c93323ecdeaa4b6183d75dd3f13469e1ef3ebd.tar.zst
PeerTube-63c93323ecdeaa4b6183d75dd3f13469e1ef3ebd.zip
Correctly forward like/dislikes and undo
Diffstat (limited to 'server/models/account/account.ts')
-rw-r--r--server/models/account/account.ts17
1 files changed, 16 insertions, 1 deletions
diff --git a/server/models/account/account.ts b/server/models/account/account.ts
index f2bd325f3..fff3ce087 100644
--- a/server/models/account/account.ts
+++ b/server/models/account/account.ts
@@ -26,6 +26,7 @@ let loadByUUID: AccountMethods.LoadByUUID
26let loadByUrl: AccountMethods.LoadByUrl 26let loadByUrl: AccountMethods.LoadByUrl
27let loadLocalByName: AccountMethods.LoadLocalByName 27let loadLocalByName: AccountMethods.LoadLocalByName
28let loadByNameAndHost: AccountMethods.LoadByNameAndHost 28let loadByNameAndHost: AccountMethods.LoadByNameAndHost
29let listByFollowersUrls: AccountMethods.ListByFollowersUrls
29let isOwned: AccountMethods.IsOwned 30let isOwned: AccountMethods.IsOwned
30let toActivityPubObject: AccountMethods.ToActivityPubObject 31let toActivityPubObject: AccountMethods.ToActivityPubObject
31let toFormattedJSON: AccountMethods.ToFormattedJSON 32let toFormattedJSON: AccountMethods.ToFormattedJSON
@@ -188,7 +189,8 @@ export default function defineAccount (sequelize: Sequelize.Sequelize, DataTypes
188 loadByUUID, 189 loadByUUID,
189 loadByUrl, 190 loadByUrl,
190 loadLocalByName, 191 loadLocalByName,
191 loadByNameAndHost 192 loadByNameAndHost,
193 listByFollowersUrls
192 ] 194 ]
193 const instanceMethods = [ 195 const instanceMethods = [
194 isOwned, 196 isOwned,
@@ -427,3 +429,16 @@ loadByUrl = function (url: string, transaction?: Sequelize.Transaction) {
427 429
428 return Account.findOne(query) 430 return Account.findOne(query)
429} 431}
432
433listByFollowersUrls = function (followersUrls: string[], transaction?: Sequelize.Transaction) {
434 const query: Sequelize.FindOptions<AccountAttributes> = {
435 where: {
436 followersUrl: {
437 [Sequelize.Op.in]: followersUrls
438 }
439 },
440 transaction
441 }
442
443 return Account.findAll(query)
444}