Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: added missing group chat properties #2362

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/api/model/chat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,14 @@ export interface Chat {
archive: boolean;
muteExpiration: number;
name: string;
/** Whatsapp provides us with built-in spam detection and this is its indicator */
notSpam: boolean;
pin: number;
msgs: null;
kind: string;
isAnnounceGrpRestrict: boolean;
ephemeralDuration: number;
/** whether the chat is visually open in WhatsApp Web (see `UILayer.openChat()`) */
hasChatBeenOpened: boolean;
unreadMentionCount: number;
hasUnreadMention: boolean;
Expand All @@ -47,4 +49,7 @@ export interface Chat {
contact: Contact;
groupMetadata: GroupMetadata;
presence: Presence;
restricted: boolean;
/** if you can send messages into the chat without having to be an admin (refers to group chats, see the `isGroup` attribute) */
hasOpened: boolean;
}
16 changes: 14 additions & 2 deletions src/api/model/group-metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export interface GroupMetadata {
descTime: number;
descOwner: Wid;
restrict: boolean;
/** whether it is an announcement channel of a community */
announce: boolean;
noFrequentlyForwarded: boolean;
ephemeralDuration: number;
Expand All @@ -56,11 +57,22 @@ export interface GroupMetadata {
incognito: boolean;
hasCapi: boolean;
displayCadminPromotion: boolean;
participants: any[];
/** Current members of the group. See `pastParticipants` for former members. */
participants: {
id: Wid;
isAdmin: boolean;
isSuperAdmin: boolean;
}[];
/** members who applied for membership but still need admin approval */
pendingParticipants: any[];
/** former members who left the group or were kicked out */
pastParticipants: any[];
pastParticipants: {
id: Wid;
/** UNIX timestamp in seconds of when the leaving occurred */
leaveTs: number;
/** was leaving volumtary (`"Left"`) or forceful (`"Removed"`) */
leaveReason: 'Left' | 'Removed';
}[];
membershipApprovalRequests: any[];
subgroupSuggestions: any[];
}
Loading