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);
|
const actorId = owningUser.getProperty(UserProps.ActivityPubActorId);
|
||||||
if (!actorId) {
|
if (!actorId) {
|
||||||
return cb(
|
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) {
|
static _rowToObjectInfo(row) {
|
||||||
return {
|
return {
|
||||||
name: row.name,
|
name: row.name,
|
||||||
|
|
|
@ -47,7 +47,7 @@ function profile(webServer, user) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function avatar(webServer, user, filename) {
|
function avatar(webServer, user, filename) {
|
||||||
return makeUserUrl(this.webServer, user, '/users/') + `/avatar/${filename}`;
|
return makeUserUrl(webServer, user, '/users/') + `/avatar/${filename}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
function sharedInbox(webServer) {
|
function sharedInbox(webServer) {
|
||||||
|
|
|
@ -654,7 +654,7 @@ exports.getModule = class ActivityPubWebHandler extends WebHandlerModule {
|
||||||
return this.webServer.notImplemented(resp);
|
return this.webServer.notImplemented(resp);
|
||||||
}
|
}
|
||||||
|
|
||||||
Collection.removeById('followers', localUser, remoteActor.id, err => {
|
Collection.removeOwnedById('followers', localUser, remoteActor.id, err => {
|
||||||
if (err) {
|
if (err) {
|
||||||
return this.webServer.internalServerError(resp, err);
|
return this.webServer.internalServerError(resp, err);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue