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.
25 lines
636 B
TypeScript
25 lines
636 B
TypeScript
5 years ago
|
import { ConversationController } from '../../window';
|
||
|
import { PubKey } from '../types';
|
||
|
|
||
|
|
||
|
export async function getGroupMembers(groupId: PubKey): Promise<Array<PubKey>> {
|
||
|
const groupConversation = ConversationController.get(groupId.key);
|
||
|
const groupMembers = groupConversation.attributes.members;
|
||
|
|
||
|
if (!groupMembers) {
|
||
|
return [];
|
||
|
}
|
||
|
|
||
|
return groupMembers.map((member: string) => new PubKey(member));
|
||
|
}
|
||
|
|
||
|
export function isMediumGroup(groupId: PubKey): boolean {
|
||
|
const conversation = ConversationController.get(groupId.key);
|
||
|
|
||
|
if (!conversation) {
|
||
|
return false;
|
||
|
}
|
||
|
|
||
|
return Boolean(conversation.isMediumGroup());
|
||
|
}
|