You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
session-desktop/ts/session/utils/Groups.ts

19 lines
503 B
TypeScript

4 years ago
import { PubKey } from '../types';
import { ConvoHub } from '../conversations';
4 years ago
import { fromHexToArray } from './String';
5 years ago
export function isClosedGroup(groupId: PubKey): boolean {
const conversation = ConvoHub.use().get(groupId.key);
5 years ago
if (!conversation) {
return false;
}
return Boolean(conversation.isClosedGroup());
5 years ago
}
export function encodeGroupPubKeyFromHex(hexGroupPublicKey: string | PubKey) {
const pubkey = PubKey.cast(hexGroupPublicKey);
return fromHexToArray(pubkey.key);
}