mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-10-15 04:30:38 +00:00
core, ui: invite member of one group to another group (#7682)
* rfc: invite member of one group to another group * update * update * implement * version * update * do not show error if contact was removed when joining group --------- Co-authored-by: Evgeny @ SimpleX Chat <259188159+evgeny-simplex@users.noreply.github.com>
This commit is contained in:
co-authored by
Evgeny @ SimpleX Chat
parent
1053e9fb5c
commit
07c363849b
@@ -25,6 +25,7 @@ This file is generated automatically.
|
||||
|
||||
[Group commands](#group-commands)
|
||||
- [APIAddMember](#apiaddmember)
|
||||
- [APIAddMemberViaGroup](#apiaddmemberviagroup)
|
||||
- [APIJoinGroup](#apijoingroup)
|
||||
- [APIAcceptMember](#apiacceptmember)
|
||||
- [APIMembersRole](#apimembersrole)
|
||||
@@ -761,6 +762,52 @@ ChatCmdError: Command error (only used in WebSockets API).
|
||||
---
|
||||
|
||||
|
||||
### APIAddMemberViaGroup
|
||||
|
||||
Add member of another group to group. Requires bot to have Admin role in the group, and direct messages allowed for its role in another group.
|
||||
|
||||
*Network usage*: interactive.
|
||||
|
||||
**Parameters**:
|
||||
- groupId: int64
|
||||
- viaGroupId: int64
|
||||
- groupMemberId: int64
|
||||
- memberRole: [GroupMemberRole](./TYPES.md#groupmemberrole)
|
||||
|
||||
**Syntax**:
|
||||
|
||||
```
|
||||
/_add #<groupId> #<viaGroupId> <groupMemberId> relay|observer|author|member|moderator|admin|owner
|
||||
```
|
||||
|
||||
```javascript
|
||||
'/_add #' + groupId + ' #' + viaGroupId + ' ' + groupMemberId + ' ' + memberRole // JavaScript
|
||||
```
|
||||
|
||||
```python
|
||||
'/_add #' + str(groupId) + ' #' + str(viaGroupId) + ' ' + str(groupMemberId) + ' ' + str(memberRole) # Python
|
||||
```
|
||||
|
||||
**Responses**:
|
||||
|
||||
SentGroupInvitationViaGroup: Group invitation sent to member of another group.
|
||||
- type: "sentGroupInvitationViaGroup"
|
||||
- user: [User](./TYPES.md#user)
|
||||
- groupInfo: [GroupInfo](./TYPES.md#groupinfo)
|
||||
- member: [GroupMember](./TYPES.md#groupmember)
|
||||
- viaGroupInfo: [GroupInfo](./TYPES.md#groupinfo)
|
||||
- viaMember: [GroupMember](./TYPES.md#groupmember)
|
||||
|
||||
ChatCmdError: Command error (only used in WebSockets API).
|
||||
- type: "chatCmdError"
|
||||
- chatError: [ChatError](./TYPES.md#chaterror)
|
||||
|
||||
**Errors**:
|
||||
- PeerChatVRangeIncompatible: Member's client version is older than required.
|
||||
|
||||
---
|
||||
|
||||
|
||||
### APIJoinGroup
|
||||
|
||||
Join group.
|
||||
|
||||
@@ -25,6 +25,7 @@ This file is generated automatically.
|
||||
[Group events](#group-events)
|
||||
- Main events
|
||||
- [ReceivedGroupInvitation](#receivedgroupinvitation)
|
||||
- [ReceivedGroupInvitationViaGroup](#receivedgroupinvitationviagroup)
|
||||
- [UserJoinedGroup](#userjoinedgroup)
|
||||
- [GroupUpdated](#groupupdated)
|
||||
- [JoinedGroupMember](#joinedgroupmember)
|
||||
@@ -286,6 +287,22 @@ Received group invitation.
|
||||
---
|
||||
|
||||
|
||||
### ReceivedGroupInvitationViaGroup
|
||||
|
||||
Received group invitation from member of another group.
|
||||
|
||||
**Record type**:
|
||||
- type: "receivedGroupInvitationViaGroup"
|
||||
- user: [User](./TYPES.md#user)
|
||||
- groupInfo: [GroupInfo](./TYPES.md#groupinfo)
|
||||
- viaGroupInfo: [GroupInfo](./TYPES.md#groupinfo)
|
||||
- viaMember: [GroupMember](./TYPES.md#groupmember)
|
||||
- fromMemberRole: [GroupMemberRole](./TYPES.md#groupmemberrole)
|
||||
- memberRole: [GroupMemberRole](./TYPES.md#groupmemberrole)
|
||||
|
||||
---
|
||||
|
||||
|
||||
### UserJoinedGroup
|
||||
|
||||
Bot user joined group. Received when connection via group link completes.
|
||||
|
||||
@@ -119,6 +119,7 @@ chatCommandsDocsData =
|
||||
( "Group commands",
|
||||
"Commands to manage and moderate groups. These commands can be used with business chats as well - they are groups. E.g., a common scenario would be to add human agents to business chat with the customer who connected via business address.",
|
||||
[ ("APIAddMember", [], "Add contact to group. Requires bot to have Admin role.", ["CRSentGroupInvitation", "CRChatCmdError"], [], Just UNInteractive, "/_add #" <> Param "groupId" <> " " <> Param "contactId" <> " " <> Param "memberRole"),
|
||||
("APIAddMemberViaGroup", [], "Add member of another group to group. Requires bot to have Admin role in the group, and direct messages allowed for its role in another group.", ["CRSentGroupInvitationViaGroup", "CRChatCmdError"], [TD "CEPeerChatVRangeIncompatible" "Member's client version is older than required"], Just UNInteractive, "/_add #" <> Param "groupId" <> " #" <> Param "viaGroupId" <> " " <> Param "groupMemberId" <> " " <> Param "memberRole"),
|
||||
("APIJoinGroup", ["enableNtfs"], "Join group.", ["CRUserAcceptedGroupSent", "CRChatCmdError"], [], Just UNInteractive, "/_join #" <> Param "groupId"),
|
||||
("APIAcceptMember", [], "Accept group member. Requires Admin role.", ["CRMemberAccepted", "CRChatCmdError"], [TD "CEGroupMemberNotActive" "Member is not connected yet"], Just UNBackground, "/_accept member #" <> Param "groupId" <> " " <> Param "groupMemberId" <> " " <> Param "memberRole"),
|
||||
("APIMembersRole", [], "Set members role. Requires Admin role.", ["CRMembersRoleUser", "CRChatCmdError"], [], Just UNBackground, "/_member role #" <> Param "groupId" <> " " <> Join ',' "groupMemberIds" <> " " <> Param "memberRole"),
|
||||
|
||||
@@ -85,6 +85,7 @@ chatEventsDocsData =
|
||||
"Bots may use these events to manage users' groups and business address groups.\n\n\
|
||||
\*Please note*: programming groups is more complex than programming direct connections",
|
||||
[ ("CEvtReceivedGroupInvitation", ""),
|
||||
("CEvtReceivedGroupInvitationViaGroup", "Received group invitation from member of another group."),
|
||||
("CEvtUserJoinedGroup", "Bot user joined group. Received when connection via group link completes."),
|
||||
("CEvtGroupUpdated", "Group profile or preferences updated."),
|
||||
("CEvtJoinedGroupMember", "Another member joined group."),
|
||||
|
||||
@@ -92,6 +92,7 @@ chatResponsesDocsData =
|
||||
("CRRemoteCtrlConnecting", "Remote controller is connecting."),
|
||||
("CRSentConfirmation", "Confirmation sent to one-time invitation"),
|
||||
("CRSentGroupInvitation", "Group invitation sent"),
|
||||
("CRSentGroupInvitationViaGroup", "Group invitation sent to member of another group"),
|
||||
("CRSentInvitation", "Invitation sent to contact address"),
|
||||
("CRSentInvitationToContact", "Invitation sent to contact (when connecting via SimpleX name to a known contact address)."),
|
||||
("CRServiceReplyAccepted", "Service reply accepted for delivery. `connectionId` correlates the reply delivery event."),
|
||||
|
||||
Reference in New Issue
Block a user