Cleanup
This commit is contained in:
parent
c9b3c9bc41
commit
39a49f00be
|
@ -457,7 +457,7 @@ module.exports = class Collection extends ActivityPubObject {
|
|||
);
|
||||
}
|
||||
|
||||
static removeById(collectionName, owningUser, objectId, cb) {
|
||||
static removeOwnedById(collectionName, owningUser, objectId, cb) {
|
||||
const actorId = owningUser.getProperty(UserProps.ActivityPubActorId);
|
||||
if (!actorId) {
|
||||
return cb(
|
||||
|
@ -476,6 +476,17 @@ module.exports = class Collection extends ActivityPubObject {
|
|||
);
|
||||
}
|
||||
|
||||
static removeById(collectionName, objectId, cb) {
|
||||
apDb.run(
|
||||
`DELETE FROM collection
|
||||
WHERE name = ? AND object_id = ?;`,
|
||||
[collectionName, objectId],
|
||||
err => {
|
||||
return cb(err);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
static _rowToObjectInfo(row) {
|
||||
return {
|
||||
name: row.name,
|
||||
|
|
|
@ -47,7 +47,7 @@ function profile(webServer, user) {
|
|||
}
|
||||
|
||||
function avatar(webServer, user, filename) {
|
||||
return makeUserUrl(this.webServer, user, '/users/') + `/avatar/${filename}`;
|
||||
return makeUserUrl(webServer, user, '/users/') + `/avatar/${filename}`;
|
||||
}
|
||||
|
||||
function sharedInbox(webServer) {
|
||||
|
|
|
@ -654,7 +654,7 @@ exports.getModule = class ActivityPubWebHandler extends WebHandlerModule {
|
|||
return this.webServer.notImplemented(resp);
|
||||
}
|
||||
|
||||
Collection.removeById('followers', localUser, remoteActor.id, err => {
|
||||
Collection.removeOwnedById('followers', localUser, remoteActor.id, err => {
|
||||
if (err) {
|
||||
return this.webServer.internalServerError(resp, err);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue