mirror of
https://github.com/fluxerapp/fluxer
synced 2026-10-18 13:35:42 +09:00
chore(repo): remove dead code and useless tests (#3375)
This commit is contained in:
1 parent
7e177a1c90
commit
1cd62eb661
1391 files changed
+783
-120415
No files matched your search
@@ -2,7 +2,6 @@
|
||||
|
||||
import {APIErrorCodes} from '@fluxer/constants/src/ApiErrorCodes';
|
||||
import {ALL_PERMISSIONS, ChannelTypes, Permissions} from '@fluxer/constants/src/ChannelConstants';
|
||||
import {THREAD_CHANNEL_TYPES} from '@fluxer/constants/src/ThreadConstants';
|
||||
|
||||
export const ThreadPermissionFlags = {
|
||||
MANAGE_THREADS: 1n << 34n,
|
||||
@@ -89,10 +88,6 @@ export function threadViewPermissions(parentPerms: bigint): bigint {
|
||||
: withoutSend;
|
||||
}
|
||||
|
||||
export function messageSendPermissionFor(type: number): bigint {
|
||||
return THREAD_CHANNEL_TYPES.has(type) ? ThreadPermissionFlags.SEND_MESSAGES_IN_THREADS : Permissions.SEND_MESSAGES;
|
||||
}
|
||||
|
||||
export function canViewThread(ctx: ThreadActorContext): ThreadDenial | null {
|
||||
const perms = withImplicitThreadBits(ctx.permissions);
|
||||
if (!ctx.isOwner && !has(perms, Permissions.VIEW_CHANNEL)) return APIErrorCodes.MISSING_ACCESS;
|
||||
|
||||
Reference in new issue
Block a user