Disallow disappearing messages if convo is not approved by recipient.
This commit is contained in:
parent
f5972a5d1c
commit
c0622d47f4
|
@ -474,5 +474,6 @@
|
|||
"openMessageRequestInbox": "View Message Requests",
|
||||
"noMessageRequestsPending": "No pending message requests",
|
||||
"noMediaUntilApproved": "You cannot send attachments until the conversation is approved",
|
||||
"mustBeApproved": "This conversation must be accepted to use this feature",
|
||||
"openMessageRequestInboxDescription": "View your Message Request inbox"
|
||||
}
|
||||
|
|
|
@ -334,6 +334,11 @@ export async function setDisappearingMessagesByConvoId(
|
|||
) {
|
||||
const conversation = getConversationController().get(conversationId);
|
||||
|
||||
if (!conversation.didApproveMe()) {
|
||||
ToastUtils.pushMustBeApproved();
|
||||
return;
|
||||
}
|
||||
|
||||
if (!seconds || seconds <= 0) {
|
||||
await conversation.updateExpireTimer(null);
|
||||
} else {
|
||||
|
|
|
@ -928,11 +928,7 @@ export class ConversationModel extends Backbone.Model<ConversationAttributes> {
|
|||
// for handling edge case for syncing/linking devices.
|
||||
// if convo has a message by us, we have replied - which is considered as approved
|
||||
// if (!this.isMe()) {
|
||||
if (!this.isMe()) {
|
||||
if (!this.isApproved() && this.isPrivate()) {
|
||||
this.setIsApproved(true);
|
||||
}
|
||||
}
|
||||
// if (!this.isApproved() && this.isPrivate()) {
|
||||
// this.setIsApproved(true);
|
||||
// }
|
||||
// }
|
||||
|
|
|
@ -283,3 +283,7 @@ export function pushNoAudioOutputFound() {
|
|||
export function pushNoMediaUntilApproved() {
|
||||
pushToastError('noMediaUntilApproved', window.i18n('noMediaUntilApproved'));
|
||||
}
|
||||
|
||||
export function pushMustBeApproved() {
|
||||
pushToastError('mustBeApproved', window.i18n('mustBeApproved'));
|
||||
}
|
||||
|
|
|
@ -477,4 +477,5 @@ export type LocalizerKeys =
|
|||
| 'hideRequestBanner'
|
||||
| 'noMessageRequestsPending'
|
||||
| 'noMediaUntilApproved'
|
||||
| 'mustBeApproved'
|
||||
| 'reportIssue';
|
||||
|
|
Loading…
Reference in New Issue