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