mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-12-19 23:10:21 +01:00
chore: small var rename
This commit is contained in:
@@ -122,18 +122,18 @@ Controller.postInbox = async (req, res) => {
|
|||||||
|
|
||||||
Controller.follow = async (req, res) => {
|
Controller.follow = async (req, res) => {
|
||||||
try {
|
try {
|
||||||
const { uid: objectId } = req.params;
|
const { uid: actorId } = req.params;
|
||||||
await activitypub.send(req.uid, objectId, {
|
await activitypub.send(req.uid, actorId, {
|
||||||
type: 'Follow',
|
type: 'Follow',
|
||||||
object: {
|
object: {
|
||||||
type: 'Person',
|
type: 'Person',
|
||||||
name: objectId,
|
name: actorId,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const now = Date.now();
|
const now = Date.now();
|
||||||
await Promise.all([
|
await Promise.all([
|
||||||
db.sortedSetAdd(`followingRemote:${req.uid}`, now, objectId),
|
db.sortedSetAdd(`followingRemote:${req.uid}`, now, actorId),
|
||||||
db.incrObjectField(`user:${req.uid}`, 'followingRemoteCount'),
|
db.incrObjectField(`user:${req.uid}`, 'followingRemoteCount'),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
@@ -145,17 +145,17 @@ Controller.follow = async (req, res) => {
|
|||||||
|
|
||||||
Controller.unfollow = async (req, res) => {
|
Controller.unfollow = async (req, res) => {
|
||||||
try {
|
try {
|
||||||
const { uid: objectId } = req.params;
|
const { uid: actorId } = req.params;
|
||||||
await activitypub.send(req.uid, objectId, {
|
await activitypub.send(req.uid, actorId, {
|
||||||
type: 'Unfollow',
|
type: 'Unfollow',
|
||||||
object: {
|
object: {
|
||||||
type: 'Person',
|
type: 'Person',
|
||||||
name: objectId,
|
name: actorId,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
await Promise.all([
|
await Promise.all([
|
||||||
db.sortedSetRemove(`followingRemote:${req.uid}`, objectId),
|
db.sortedSetRemove(`followingRemote:${req.uid}`, actorId),
|
||||||
db.decrObjectField(`user:${req.uid}`, 'followingRemoteCount'),
|
db.decrObjectField(`user:${req.uid}`, 'followingRemoteCount'),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user