modifyGroupV2: useCredentialsFrom only when profileKeyCredential needed
This commit is contained in:
parent
3f0536f5a5
commit
721a875c44
2 changed files with 4 additions and 15 deletions
|
@ -620,16 +620,7 @@ export class ConversationModel extends window.Backbone
|
||||||
const idLog = this.idForLogging();
|
const idLog = this.idForLogging();
|
||||||
|
|
||||||
// Hard-coded to our own ID, because you don't add other users for admin approval
|
// Hard-coded to our own ID, because you don't add other users for admin approval
|
||||||
const conversationId =
|
const toRequest = window.ConversationController.getOurConversationOrThrow();
|
||||||
window.ConversationController.getOurConversationIdOrThrow();
|
|
||||||
|
|
||||||
const toRequest = window.ConversationController.get(conversationId);
|
|
||||||
if (!toRequest) {
|
|
||||||
throw new Error(
|
|
||||||
`addPendingApprovalRequest/${idLog}: No conversation found for conversation ${conversationId}`
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
const serviceId = toRequest.getCheckedServiceId(
|
const serviceId = toRequest.getCheckedServiceId(
|
||||||
`addPendingApprovalRequest/${idLog}`
|
`addPendingApprovalRequest/${idLog}`
|
||||||
);
|
);
|
||||||
|
@ -2658,8 +2649,6 @@ export class ConversationModel extends window.Backbone
|
||||||
|
|
||||||
const ourAci = window.textsecure.storage.user.getCheckedAci();
|
const ourAci = window.textsecure.storage.user.getCheckedAci();
|
||||||
const ourPni = window.textsecure.storage.user.getPni();
|
const ourPni = window.textsecure.storage.user.getPni();
|
||||||
const ourConversation =
|
|
||||||
window.ConversationController.getOurConversationOrThrow();
|
|
||||||
|
|
||||||
if (this.isMemberPending(ourAci)) {
|
if (this.isMemberPending(ourAci)) {
|
||||||
await this.modifyGroupV2({
|
await this.modifyGroupV2({
|
||||||
|
@ -2670,7 +2659,7 @@ export class ConversationModel extends window.Backbone
|
||||||
} else if (this.isMember(ourAci)) {
|
} else if (this.isMember(ourAci)) {
|
||||||
await this.modifyGroupV2({
|
await this.modifyGroupV2({
|
||||||
name: 'delete',
|
name: 'delete',
|
||||||
usingCredentialsFrom: [ourConversation],
|
usingCredentialsFrom: [],
|
||||||
createGroupChange: () => this.#removeMember(ourAci),
|
createGroupChange: () => this.#removeMember(ourAci),
|
||||||
});
|
});
|
||||||
// Keep PNI in pending if ACI was a member.
|
// Keep PNI in pending if ACI was a member.
|
||||||
|
@ -2749,7 +2738,7 @@ export class ConversationModel extends window.Backbone
|
||||||
|
|
||||||
await this.modifyGroupV2({
|
await this.modifyGroupV2({
|
||||||
name: 'toggleAdmin',
|
name: 'toggleAdmin',
|
||||||
usingCredentialsFrom: [member],
|
usingCredentialsFrom: [],
|
||||||
createGroupChange: () => this.#toggleAdminChange(serviceId),
|
createGroupChange: () => this.#toggleAdminChange(serviceId),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -3473,7 +3473,7 @@ function approvePendingMembershipFromGroupV2(
|
||||||
);
|
);
|
||||||
await modifyGroupV2({
|
await modifyGroupV2({
|
||||||
conversation,
|
conversation,
|
||||||
usingCredentialsFrom: [pendingMember],
|
usingCredentialsFrom: [],
|
||||||
createGroupChange: async () => {
|
createGroupChange: async () => {
|
||||||
// This user's pending state may have changed in the time between the user's
|
// This user's pending state may have changed in the time between the user's
|
||||||
// button press and when we get here. It's especially important to check here
|
// button press and when we get here. It's especially important to check here
|
||||||
|
|
Loading…
Add table
Reference in a new issue