-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: new function to change group permission
- Loading branch information
1 parent
9166c68
commit 9f4eeef
Showing
3 changed files
with
22 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -72,6 +72,7 @@ declare module WAPI { | |
const markUnseenMessage: (messageId: string) => boolean; | ||
const blockContact: (messageId: string) => boolean; | ||
const unblockContact: (messageId: string) => boolean; | ||
const setMessagesAdminsOnly: (chatId: string, option: boolean) => boolean; | ||
} | ||
|
||
export class ControlsLayer extends UILayer { | ||
|
@@ -189,4 +190,17 @@ export class ControlsLayer extends UILayer { | |
{ contactId: chatId, messageId, onlyLocal } | ||
); | ||
} | ||
|
||
/** | ||
* Archive and unarchive chat messages with true or false | ||
* @param chatId {string} id '[email protected]' | ||
* @param option {boolean} true or false | ||
* @returns boolean | ||
*/ | ||
public async setMessagesAdminsOnly(chatId: string, option: boolean) { | ||
return this.page.evaluate( | ||
({ chatId, option }) => WAPI.setMessagesAdminsOnly(chatId, option), | ||
{ chatId, option } | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9f4eeef
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#294