is-medium-group
parent
bffb43dd19
commit
35665f3cb6
@ -0,0 +1,24 @@
|
|||||||
|
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());
|
||||||
|
}
|
@ -1,7 +1,8 @@
|
|||||||
import * as MessageUtils from './Messages';
|
import * as MessageUtils from './Messages';
|
||||||
|
import * as GroupUtils from './Groups';
|
||||||
import * as SyncMessageUtils from './SyncMessageUtils';
|
import * as SyncMessageUtils from './SyncMessageUtils';
|
||||||
|
|
||||||
export * from './TypedEmitter';
|
export * from './TypedEmitter';
|
||||||
export * from './JobQueue';
|
export * from './JobQueue';
|
||||||
|
|
||||||
export { MessageUtils, SyncMessageUtils };
|
export { MessageUtils, SyncMessageUtils, GroupUtils };
|
||||||
|
Loading…
Reference in New Issue