mirror of
https://github.com/spacebarchat/server.git
synced 2024-11-08 03:42:34 +01:00
fix channel permission calc
This commit is contained in:
parent
882f71343b
commit
952a056014
@ -128,7 +128,7 @@ export class Permissions extends BitField {
|
|||||||
// ~ operator inverts deny (e.g. 011 -> 100)
|
// ~ operator inverts deny (e.g. 011 -> 100)
|
||||||
// & operator only allows 1 for both ~deny and permission (e.g. 010 & 100 -> 000)
|
// & operator only allows 1 for both ~deny and permission (e.g. 010 & 100 -> 000)
|
||||||
// | operators adds both together (e.g. 000 + 100 -> 100)
|
// | operators adds both together (e.g. 000 + 100 -> 100)
|
||||||
}, 0n ?? init);
|
}, init || 0n);
|
||||||
}
|
}
|
||||||
|
|
||||||
static rolePermission(roles: Role[]) {
|
static rolePermission(roles: Role[]) {
|
||||||
|
@ -109,7 +109,7 @@ export class Snowflake {
|
|||||||
static deconstruct(snowflake) {
|
static deconstruct(snowflake) {
|
||||||
const BINARY = Snowflake.idToBinary(snowflake).toString(2).padStart(64, "0");
|
const BINARY = Snowflake.idToBinary(snowflake).toString(2).padStart(64, "0");
|
||||||
const res = {
|
const res = {
|
||||||
timestamp: parseInt(BINARY.substring(0, 42), 2) + EPOCH,
|
timestamp: parseInt(BINARY.substring(0, 42), 2) + Snowflake.EPOCH,
|
||||||
workerID: parseInt(BINARY.substring(42, 47), 2),
|
workerID: parseInt(BINARY.substring(42, 47), 2),
|
||||||
processID: parseInt(BINARY.substring(47, 52), 2),
|
processID: parseInt(BINARY.substring(47, 52), 2),
|
||||||
increment: parseInt(BINARY.substring(52, 64), 2),
|
increment: parseInt(BINARY.substring(52, 64), 2),
|
||||||
|
Loading…
Reference in New Issue
Block a user