-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
feat: new chat/group settings + methods + minor updates #2444
Draft
alechkos
wants to merge
75
commits into
pedroslopez:main
Choose a base branch
from
alechkos:chat-group-props
base: main
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+586
−46
Conversation
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
alechkos
changed the title
feat: added group settings + fix:
feat: added group settings + small fixes
Aug 27, 2023
GroupChat
methods
alechkos
force-pushed
the
chat-group-props
branch
from
August 27, 2023 01:17
4a24273
to
1046b42
Compare
tuyuribr
added
good pr
breaking change
Fix or feature that would cause existing functionality to change
labels
Aug 28, 2023
alechkos
force-pushed
the
chat-group-props
branch
from
August 28, 2023 01:17
1046b42
to
582c6cb
Compare
tuyuribr
removed
the
breaking change
Fix or feature that would cause existing functionality to change
label
Aug 28, 2023
matheus-de-araujo
approved these changes
Dec 22, 2023
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.
Very document code, congratulations
alechkos
added
the
waiting for testers
Waiting for other people test this PR in other envs
label
Jan 13, 2024
Repository owner
locked and limited conversation to collaborators
Apr 16, 2024
Repository owner
unlocked this conversation
Apr 19, 2024
Did this also fix set group description and set group profile pic? If not, I can provide it if u like. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Table of Contents
- Description
- Related Issues
- Usage Example
- I Want to Test this PR
- I Got an Error While Testing This PR ❌
- How Has the PR Been Tested (latest test on 01.11.2023)
- Types of Changes
Description
Added new chat and group settings:
Chat.setMessageExpiration
- sets the Message Expiration Timer for a chat or a group. Valid values for passing to the method are:GroupChat.setMembershipApprovalMode
- sets the Membership Approval Mode in a group. When turned on, group admins will be required to approve anyone who wishes to join the groupGroupChat.setReportToAdminMode
- sets the Report To Admin Mode. When turned on, every group participant could report every message sent in the group, these reports will be sent to group admins for review. Group admins could see those reports in Sent for admin review section in the group and make manipulations with those messagesGroupChat.setGroupMemberAddMode
– sets who can add others to the group: either only admins or all the group members. If turned on, only the group admins can add others to the groupAdded new methods:
Message.sendForAdminReview
allows sending any group message to group admins for a review (to report that message to admins)GroupChat.getReportedMessages
– gets the reported to group admins messages sent in that groupChat.hasKeptMessages
- indicates if there are kept messages in that chatChat.getKeptMessages
- gets kept messages from that chatMessage.keepMessage
andMessage.unkeepMessage
- methods for keeping/unkeeping messages in a chatEvents:
message_kept_unkept
event that is emitted when message was kept or unkeptgroup_join
event: added a case when a user joins the group after the admin approvalgroup_leave
event: is now emitted also when a current user leaves a group or a communitygroup_admin_changed
event: is now emitted when any group member is promoted or demoted (not only the current user as before)Other changes:
groupMetadata
extended with properties:iAmMember
- indicates if a current user is a member in the groupiAmAdmin
- indicates if a current user is an admin in the groupiAmSuperAdmin
- indicates if a current user is an admin who created the groupephemeralDuration
- the duration (in seconds) in which messages will disappear in chat (if the corresponding setting is enabled)Related Issues
The PR closes #2441, closes #1559
Usage Example
1. To set the message expiration timer:
2. To set the Membership Approval Mode:
3. To set the Report To Admin Mode:
4. To set the Group Member Add Mode:
5. To send a message for a group admin review:
6. To get reported to group admin messages sent in that group:
7. To check if a chat or a group has kept messages:
8. To get kept messages from a chat or a group:
9. To keep or unkeep a message:
10. To listen to message status, whether was kept or unkept:
To test this PR by yourself you can run one of the following commands:
If you encounter any errors while testing this PR, please provide in a comment:
console.log(await client.getWWebVersion());
Important
You have to reapply the PR each time it is changed (new commits were pushed since your last application)
How Has The PR Been Tested (latest test on 01.11.2023)
The PR was tested with a code provided in usage example.
Tested On:
Types of accounts:
Environment:
Types of Changes
Checklist