Remove accepted message without explicit user action
This commit is contained in:
parent
8a21f8655f
commit
11ea595457
6 changed files with 28 additions and 39 deletions
|
@ -2163,11 +2163,15 @@ export class ConversationModel extends window.Backbone
|
|||
|
||||
if (didResponseChange) {
|
||||
if (response === messageRequestEnum.ACCEPT) {
|
||||
drop(
|
||||
this.addMessageRequestResponseEventMessage(
|
||||
MessageRequestResponseEvent.ACCEPT
|
||||
)
|
||||
);
|
||||
// Only add a message when the user took an explicit action to accept
|
||||
// the message request on one of their devices
|
||||
if (!viaStorageServiceSync) {
|
||||
drop(
|
||||
this.addMessageRequestResponseEventMessage(
|
||||
MessageRequestResponseEvent.ACCEPT
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
if (
|
||||
response === messageRequestEnum.BLOCK ||
|
||||
|
|
|
@ -114,7 +114,7 @@ Bootstrap.benchmark(async (bootstrap: Bootstrap): Promise<void> => {
|
|||
const item = leftPane
|
||||
.locator(
|
||||
'.module-conversation-list__item--contact-or-conversation' +
|
||||
'>> text="You accepted the message request"'
|
||||
`>> text="${LAST_MESSAGE}"`
|
||||
)
|
||||
.first();
|
||||
await item.click({ timeout: 2 * MINUTE });
|
||||
|
|
|
@ -149,7 +149,7 @@ describe('pnp/merge', function (this: Mocha.Suite) {
|
|||
assert.strictEqual(await messages.count(), 0, 'message count');
|
||||
|
||||
await expectSystemMessages(window, [
|
||||
'You accepted the message request',
|
||||
// none
|
||||
]);
|
||||
}
|
||||
|
||||
|
@ -210,21 +210,16 @@ describe('pnp/merge', function (this: Mocha.Suite) {
|
|||
if (withPNIMessage) {
|
||||
if (pniSignatureVerified) {
|
||||
await expectSystemMessages(window, [
|
||||
'You accepted the message request',
|
||||
'You accepted the message request',
|
||||
/Your message history with ACI Contact and their number .* has been merged\./,
|
||||
]);
|
||||
} else {
|
||||
await expectSystemMessages(window, [
|
||||
'You accepted the message request',
|
||||
'You accepted the message request',
|
||||
/Your message history with ACI Contact and their number .* has been merged\./,
|
||||
]);
|
||||
}
|
||||
} else {
|
||||
await expectSystemMessages(window, [
|
||||
'You accepted the message request',
|
||||
'You accepted the message request',
|
||||
// none
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -144,10 +144,7 @@ describe('pnp/phone discovery', function (this: Mocha.Suite) {
|
|||
const messages = window.locator('.module-message__text');
|
||||
assert.strictEqual(await messages.count(), 1, 'message count');
|
||||
|
||||
await expectSystemMessages(window, [
|
||||
'You accepted the message request',
|
||||
/.* belongs to ACI Contact/,
|
||||
]);
|
||||
await expectSystemMessages(window, [/.* belongs to ACI Contact/]);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
|
@ -96,9 +96,9 @@ describe('pnp/PNI Change', function (this: Mocha.Suite) {
|
|||
// No messages
|
||||
const messages = window.locator('.module-message__text');
|
||||
assert.strictEqual(await messages.count(), 0, 'message count');
|
||||
|
||||
// No notifications
|
||||
await expectSystemMessages(window, ['You accepted the message request']);
|
||||
await expectSystemMessages(window, [
|
||||
// none
|
||||
]);
|
||||
}
|
||||
|
||||
debug('Send message to contactA');
|
||||
|
@ -165,10 +165,7 @@ describe('pnp/PNI Change', function (this: Mocha.Suite) {
|
|||
assert.strictEqual(await messages.count(), 1, 'message count');
|
||||
|
||||
// Only a PhoneNumberDiscovery notification
|
||||
await expectSystemMessages(window, [
|
||||
'You accepted the message request',
|
||||
/.* belongs to ContactA/,
|
||||
]);
|
||||
await expectSystemMessages(window, [/.* belongs to ContactA/]);
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -198,7 +195,9 @@ describe('pnp/PNI Change', function (this: Mocha.Suite) {
|
|||
const messages = window.locator('.module-message__text');
|
||||
assert.strictEqual(await messages.count(), 0, 'message count');
|
||||
|
||||
await expectSystemMessages(window, ['You accepted the message request']);
|
||||
await expectSystemMessages(window, [
|
||||
// 'You accepted the message request'
|
||||
]);
|
||||
}
|
||||
|
||||
debug('Send message to contactA');
|
||||
|
@ -266,7 +265,6 @@ describe('pnp/PNI Change', function (this: Mocha.Suite) {
|
|||
|
||||
// Two notifications - the safety number change and PhoneNumberDiscovery
|
||||
await expectSystemMessages(window, [
|
||||
'You accepted the message request',
|
||||
/.* belongs to ContactA/,
|
||||
/Safety Number has changed/,
|
||||
]);
|
||||
|
@ -299,7 +297,9 @@ describe('pnp/PNI Change', function (this: Mocha.Suite) {
|
|||
const messages = window.locator('.module-message__text');
|
||||
assert.strictEqual(await messages.count(), 0, 'message count');
|
||||
|
||||
await expectSystemMessages(window, ['You accepted the message request']);
|
||||
await expectSystemMessages(window, [
|
||||
// none
|
||||
]);
|
||||
}
|
||||
|
||||
debug('Send message to contactA');
|
||||
|
@ -397,7 +397,6 @@ describe('pnp/PNI Change', function (this: Mocha.Suite) {
|
|||
|
||||
// Three notifications - accepted, the safety number change and PhoneNumberDiscovery
|
||||
await expectSystemMessages(window, [
|
||||
'You accepted the message request',
|
||||
/.* belongs to ContactA/,
|
||||
/Safety Number has changed/,
|
||||
]);
|
||||
|
@ -429,9 +428,9 @@ describe('pnp/PNI Change', function (this: Mocha.Suite) {
|
|||
// No messages
|
||||
const messages = window.locator('.module-message__text');
|
||||
assert.strictEqual(await messages.count(), 0, 'message count');
|
||||
|
||||
// No notifications
|
||||
await expectSystemMessages(window, ['You accepted the message request']);
|
||||
await expectSystemMessages(window, [
|
||||
// none
|
||||
]);
|
||||
}
|
||||
|
||||
debug('Send message to contactA');
|
||||
|
@ -551,10 +550,7 @@ describe('pnp/PNI Change', function (this: Mocha.Suite) {
|
|||
assert.strictEqual(await messages.count(), 2, 'message count');
|
||||
|
||||
// Only a PhoneNumberDiscovery notification
|
||||
await expectSystemMessages(window, [
|
||||
'You accepted the message request',
|
||||
/.* belongs to ContactA/,
|
||||
]);
|
||||
await expectSystemMessages(window, [/.* belongs to ContactA/]);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
|
@ -423,10 +423,7 @@ describe('pnp/PNI Signature', function (this: Mocha.Suite) {
|
|||
assert.strictEqual(await messages.count(), 3, 'messages');
|
||||
|
||||
// Title transition notification
|
||||
await expectSystemMessages(window, [
|
||||
'You accepted the message request',
|
||||
/You started this chat with/,
|
||||
]);
|
||||
await expectSystemMessages(window, [/You started this chat with/]);
|
||||
|
||||
assert.isEmpty(await phone.getOrphanedStorageKeys());
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue