forked from FoundKeyGang/FoundKey
server: use named export for cancelFollowRequest
This commit is contained in:
parent
2204adc657
commit
28f65bebfc
3 changed files with 4 additions and 4 deletions
|
@ -1,5 +1,5 @@
|
||||||
import unfollow from '@/services/following/delete.js';
|
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 { CacheableRemoteUser } from '@/models/entities/user.js';
|
||||||
import { FollowRequests, Followings } from '@/models/index.js';
|
import { FollowRequests, Followings } from '@/models/index.js';
|
||||||
import { IFollow } from '@/remote/activitypub/type.js';
|
import { IFollow } from '@/remote/activitypub/type.js';
|
||||||
|
@ -29,7 +29,7 @@ export default async (actor: CacheableRemoteUser, activity: IFollow): Promise<st
|
||||||
]);
|
]);
|
||||||
|
|
||||||
if (req) {
|
if (req) {
|
||||||
await cancelRequest(followee, actor);
|
await cancelFollowRequest(followee, actor);
|
||||||
return 'ok: follow request canceled';
|
return 'ok: follow request canceled';
|
||||||
} else if (following) {
|
} else if (following) {
|
||||||
await unfollow(actor, followee);
|
await unfollow(actor, followee);
|
||||||
|
|
|
@ -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 { Users } from '@/models/index.js';
|
||||||
import { IdentifiableError } from '@/misc/identifiable-error.js';
|
import { IdentifiableError } from '@/misc/identifiable-error.js';
|
||||||
import define from '../../../define.js';
|
import define from '../../../define.js';
|
||||||
|
|
|
@ -7,7 +7,7 @@ import { IdentifiableError } from '@/misc/identifiable-error.js';
|
||||||
import { User } from '@/models/entities/user.js';
|
import { User } from '@/models/entities/user.js';
|
||||||
import { Users, FollowRequests } from '@/models/index.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)) {
|
if (Users.isRemoteUser(followee)) {
|
||||||
const content = renderActivity(renderUndo(renderFollow(follower, followee), follower));
|
const content = renderActivity(renderUndo(renderFollow(follower, followee), follower));
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue