diff --git a/src/api/model/group-metadata.ts b/src/api/model/group-metadata.ts index 584ce53870..45919721d6 100644 --- a/src/api/model/group-metadata.ts +++ b/src/api/model/group-metadata.ts @@ -3,11 +3,28 @@ import { Contact } from './contact' export interface Participant { contact: Contact, - id: NonSerializedId, + id: ContactId, isAdmin: boolean, isSuperAdmin: boolean } +export interface PastParticipant { + id: ContactId, + leaveTs: number, + leaveReason: "Removed" | "Left" +} + +export interface membershipApprovalRequest { + id: ContactId, + t: number + addedBy: ContactId + /** + * The only known value is 'LinkedGroupJoin' + */ + requestMethod: string + parentGroupId: GroupId +} + export interface GroupMetadata { /** * The chat id of the group [[GroupChatId]] @@ -20,27 +37,67 @@ export interface GroupMetadata { /** * The id of the owner of the group [[ContactId]] */ - owner: NonSerializedId; + owner: ContactId; /** - * An array of participants in the group + * The name of the Group */ - participants: Participant[]; + subject: string; /** - * Unknown. + * The creation time of the group */ - pendingParticipants: Participant[]; + subjectTime: number; /** * The description of the group */ desc ?: string; + /** + * Unknown + */ + descId ?: string; + /** + * The timestamp of when the description was last updated, it appear to be only exists within communities group? + */ + descTime ?: number; /** * The account that set the description last. */ descOwner ?: ContactId; /** - * + * Unknown use */ - trusted ?: boolean; + restrict : boolean; + /** + * Unknown use + */ + announce : boolean; + /** + * Unknown use + */ + noFrequentlyForwarded : boolean; + /** + * Unknown use + */ + ephemeralDuration : number; + /** + * Is member need to be approved to join + */ + membershipApprovalMode : boolean; + /** + * Member add mode + */ + memberAddMode ?: "all_member_add" | "admin_add" + /** + * Unknown use + */ + reportToAdminMode ?: boolean; + /** + * Group size + */ + size : number; + /** + * Not sure what this represents + */ + support ?: boolean; /** * Not sure what this represents */ @@ -48,27 +105,83 @@ export interface GroupMetadata { /** * Not sure what this represents */ - support ?: boolean; + terminated ?: boolean; + /** + * Not sure what this represents + */ + uniqueShortNameMap : Record; + /** + * Not sure what this represents + */ + isLidAddressingMode : boolean; /** * Is this group a parent group (a.k.a community) */ - isParentGroup ?: boolean - /** - * The type of group - */ - groupType: 'DEAFULT' | 'SUBGROUP' | 'COMMUNITY' - /** - * Communities have a default group chat - */ - defaultSubgroup: boolean - /** - * - */ - isParentGroupClosed: boolean - /** - * List of Group IDs that the host account has joined as part of this community - */ - joinedSubgroups: GroupId[] + isParentGroup : boolean + /** + * + */ + isParentGroupClosed: boolean + /** + * The id of the parent group [[GroupId]] + */ + parentGroup: GroupId + /** + * Communities have a default group chat + */ + defaultSubgroup: boolean + /** + * Unknown + */ + generalSubgroup: boolean + /** + * Unknown + */ + generalChatAutoAddDisabled: boolean + /** + * Allow non admin to create subgroups + */ + allowNonAdminSubGroupCreation: boolean + /** + * Unknown + */ + lastActivityTimestamp?: number + /** + * Unknown + */ + incognito: boolean + /** + * Unknown + */ + hasCapi ?: boolean + /** + * An array of participants in the group + */ + participants: Participant[]; + /** + * Unknown. + */ + pendingParticipants: Participant[]; + /** + * An array of past participants, could be an empty array + */ + pastParticipants: PastParticipant[]; + /** + * members that is not approved to join group yet, could be an empty array if the bot is not an admin + */ + membershipApprovalRequests: membershipApprovalRequest[]; + /** + * Unknown, usually an empty array, please check if you found any value + */ + subgroupSuggestions: [] + /** + * The type of group - it seems to never appeared in the message + */ + groupType?: 'DEFAULT' | 'SUBGROUP' | 'COMMUNITY' + /** + * List of Group IDs that the host account has joined as part of this community - it seems to never appeared in the message + */ + joinedSubgroups: GroupId[] } export enum groupChangeEvent { @@ -128,4 +241,4 @@ export interface GenericGroupChangeEvent { * Type of the event */ type: 'picutre' | 'create' | 'delete' | 'subject' | 'revoke_invite' | 'description' | 'restrict' | 'announce' | 'no_frequently_forwarded' | 'announce_msg_bounce' | 'add' | 'remove' | 'demote' | 'promote' | 'invite' | 'leave' | 'modify' | 'v4_add_invite_sent' | 'v4_add_invite_join' | 'growth_locked' | 'growth_unlocked' | 'linked_group_join' -} \ No newline at end of file +}