server: use named export for cancelFollowRequest

This commit is contained in:
Norm 2022-12-22 16:43:38 -05:00
parent 2204adc657
commit 28f65bebfc
Signed by untrusted user: norm
GPG key ID: 7123E30E441E80DE
3 changed files with 4 additions and 4 deletions

View file

@ -1,5 +1,5 @@
import unfollow from '@/services/following/delete.js';
import cancelRequest from '@/services/following/requests/cancel.js';
import { cancelFollowRequest } from '@/services/following/requests/cancel.js';
import { CacheableRemoteUser } from '@/models/entities/user.js';
import { FollowRequests, Followings } from '@/models/index.js';
import { IFollow } from '@/remote/activitypub/type.js';
@ -29,7 +29,7 @@ export default async (actor: CacheableRemoteUser, activity: IFollow): Promise<st
]);
if (req) {
await cancelRequest(followee, actor);
await cancelFollowRequest(followee, actor);
return 'ok: follow request canceled';
} else if (following) {
await unfollow(actor, followee);

View file

@ -1,4 +1,4 @@
import cancelFollowRequest from '@/services/following/requests/cancel.js';
import { cancelFollowRequest } from '@/services/following/requests/cancel.js';
import { Users } from '@/models/index.js';
import { IdentifiableError } from '@/misc/identifiable-error.js';
import define from '../../../define.js';

View file

@ -7,7 +7,7 @@ import { IdentifiableError } from '@/misc/identifiable-error.js';
import { User } from '@/models/entities/user.js';
import { Users, FollowRequests } from '@/models/index.js';
export default async function(followee: { id: User['id']; host: User['host']; uri: User['host']; inbox: User['inbox'] }, follower: { id: User['id']; host: User['host']; uri: User['host'] }) {
export async function cancelFollowRequest(followee: User, follower: User): Promise<void> {
if (Users.isRemoteUser(followee)) {
const content = renderActivity(renderUndo(renderFollow(follower, followee), follower));