Check stories capability when sending replies
This commit is contained in:
parent
3beccbfd31
commit
d6afae64d9
2 changed files with 15 additions and 3 deletions
|
@ -3661,13 +3661,16 @@ export class ConversationModel extends window.Backbone
|
|||
getRecipients({
|
||||
includePendingMembers,
|
||||
extraConversationsForSend,
|
||||
isStoryReply = false,
|
||||
}: {
|
||||
includePendingMembers?: boolean;
|
||||
extraConversationsForSend?: Array<string>;
|
||||
isStoryReply?: boolean;
|
||||
} = {}): Array<string> {
|
||||
return getRecipients(this.attributes, {
|
||||
includePendingMembers,
|
||||
extraConversationsForSend,
|
||||
isStoryReply,
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -3939,8 +3942,11 @@ export class ConversationModel extends window.Backbone
|
|||
|
||||
const expireTimer = this.get('expireTimer');
|
||||
|
||||
const recipientMaybeConversations = map(this.getRecipients(), identifier =>
|
||||
window.ConversationController.get(identifier)
|
||||
const recipientMaybeConversations = map(
|
||||
this.getRecipients({
|
||||
isStoryReply: storyId !== undefined,
|
||||
}),
|
||||
identifier => window.ConversationController.get(identifier)
|
||||
);
|
||||
const recipientConversations = filter(
|
||||
recipientMaybeConversations,
|
||||
|
|
|
@ -15,9 +15,11 @@ export function getRecipients(
|
|||
{
|
||||
includePendingMembers,
|
||||
extraConversationsForSend,
|
||||
isStoryReply = false,
|
||||
}: {
|
||||
includePendingMembers?: boolean;
|
||||
extraConversationsForSend?: Array<string>;
|
||||
isStoryReply?: boolean;
|
||||
} = {}
|
||||
): Array<string> {
|
||||
if (isDirectConversation(conversationAttributes)) {
|
||||
|
@ -25,10 +27,14 @@ export function getRecipients(
|
|||
return [getSendTarget(conversationAttributes)!];
|
||||
}
|
||||
|
||||
const members = getConversationMembers(conversationAttributes, {
|
||||
let members = getConversationMembers(conversationAttributes, {
|
||||
includePendingMembers,
|
||||
});
|
||||
|
||||
if (isStoryReply) {
|
||||
members = members.filter(({ capabilities }) => capabilities?.stories);
|
||||
}
|
||||
|
||||
// There are cases where we need to send to someone we just removed from the group, to
|
||||
// let them know that we removed them. In that case, we need to send to more than
|
||||
// are currently in the group.
|
||||
|
|
Loading…
Reference in a new issue