New feature flag with ability to migrate GV1 groups
This commit is contained in:
@@ -2079,33 +2079,42 @@ export class MessageModel extends window.Backbone.Model<MessageAttributesType> {
|
||||
const isOutgoing = this.get('type') === 'outgoing';
|
||||
const numDelivered = this.get('delivered');
|
||||
|
||||
// Case 1: If mandatory profile sharing is enabled, and we haven't shared yet, then
|
||||
if (!conversation) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// If GroupV1 groups have been disabled, we can't reply.
|
||||
if (conversation.isGroupV1AndDisabled()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// If mandatory profile sharing is enabled, and we haven't shared yet, then
|
||||
// we can't reply.
|
||||
if (conversation?.isMissingRequiredProfileSharing()) {
|
||||
if (conversation.isMissingRequiredProfileSharing()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Case 2: We cannot reply if we have accepted the message request
|
||||
if (!conversation?.getAccepted()) {
|
||||
// We cannot reply if we haven't accepted the message request
|
||||
if (!conversation.getAccepted()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Case 3: We cannot reply if this message is deleted for everyone
|
||||
// We cannot reply if this message is deleted for everyone
|
||||
if (this.get('deletedForEveryone')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Case 4: We can reply if this is outgoing and delievered to at least one recipient
|
||||
// We can reply if this is outgoing and delievered to at least one recipient
|
||||
if (isOutgoing && numDelivered > 0) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Case 5: We can reply if there are no errors
|
||||
// We can reply if there are no errors
|
||||
if (!errors || (errors && errors.length === 0)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Case 6: default
|
||||
// Fail safe.
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user