Don't show message request after requesting to join via group link
This commit is contained in:
parent
b32dbf2c68
commit
8b627b3f1a
4 changed files with 40 additions and 7 deletions
22
ts/groups.ts
22
ts/groups.ts
|
@ -5146,10 +5146,19 @@ async function applyGroupChange({
|
|||
}
|
||||
|
||||
// Capture who added us
|
||||
if (ourAci && sourceServiceId && addedUuid === ourAci) {
|
||||
if (addedUuid === ourAci && pendingAdminApprovalMembers[ourAci]) {
|
||||
result.addedBy = ourAci;
|
||||
} else if (addedUuid === ourAci && sourceServiceId) {
|
||||
result.addedBy = sourceServiceId;
|
||||
}
|
||||
|
||||
if (pendingAdminApprovalMembers[addedUuid]) {
|
||||
log.warn(
|
||||
`applyGroupChange/${logId}: Removing newly-added member from pendingAdminApprovalMembers.`
|
||||
);
|
||||
delete pendingAdminApprovalMembers[addedUuid];
|
||||
}
|
||||
|
||||
if (added.profileKey) {
|
||||
newProfileKeys.push({
|
||||
profileKey: added.profileKey,
|
||||
|
@ -5291,6 +5300,7 @@ async function applyGroupChange({
|
|||
log.warn(
|
||||
`applyGroupChange/${logId}: Attempt to promote pendingMember failed; was not in pendingMembers.`
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
if (members[aci]) {
|
||||
|
@ -5518,6 +5528,7 @@ async function applyGroupChange({
|
|||
log.warn(
|
||||
`applyGroupChange/${logId}: Attempt to promote pendingAdminApproval failed; was not in pendingAdminApprovalMembers.`
|
||||
);
|
||||
return;
|
||||
}
|
||||
if (pendingMembers[userId]) {
|
||||
delete pendingAdminApprovalMembers[userId];
|
||||
|
@ -5533,6 +5544,11 @@ async function applyGroupChange({
|
|||
return;
|
||||
}
|
||||
|
||||
// If we had requested to join, and are approved, we added ourselves
|
||||
if (userId === ourAci) {
|
||||
result.addedBy = ourAci;
|
||||
}
|
||||
|
||||
members[userId] = {
|
||||
aci: userId,
|
||||
joinedAtVersion: version,
|
||||
|
@ -5840,7 +5856,9 @@ async function applyGroupState({
|
|||
result.left = false;
|
||||
|
||||
// Capture who added us if we were previously not in group
|
||||
if (
|
||||
if (pendingAdminApprovalMembers[ourAci] && !wasPreviouslyAMember) {
|
||||
result.addedBy = sourceServiceId;
|
||||
} else if (
|
||||
sourceServiceId &&
|
||||
!wasPreviouslyAMember &&
|
||||
isNumber(member.joinedAtVersion) &&
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue