Revert changes to AbstractProtocolEngine

This reverts parts of commit 5d143f8b33adc07d990627036b806a2becea7074.
This commit is contained in:
Sebastian Kürten
2021-03-24 15:42:40 +01:00
committed by Torsten Grote
parent 17fc81ab7a
commit eb1a089437

View File

@@ -127,17 +127,15 @@ abstract class AbstractProtocolEngine<S extends Session<?>>
Message m; Message m;
ContactId c = getContactId(txn, s.getContactGroupId()); ContactId c = getContactId(txn, s.getContactGroupId());
if (contactSupportsAutoDeletion(txn, c)) { if (contactSupportsAutoDeletion(txn, c)) {
long timer = long timer = autoDeleteManager.getAutoDeleteTimer(txn, c,
autoDeleteManager.getAutoDeleteTimer(txn, c, timestamp); timestamp);
m = messageEncoder.encodeAcceptMessage(s.getContactGroupId(), m = messageEncoder.encodeAcceptMessage(s.getContactGroupId(),
timestamp, s.getLastLocalMessageId(), s.getSessionId(), timestamp, s.getLastLocalMessageId(), s.getSessionId(),
ephemeralPublicKey, acceptTimestamp, transportProperties, ephemeralPublicKey, acceptTimestamp, transportProperties,
timer); timer);
sendMessage(txn, ACCEPT, s.getSessionId(), m, visible, timer); sendMessage(txn, ACCEPT, s.getSessionId(), m, visible, timer);
// Set the auto-delete timer duration on the message // Set the auto-delete timer duration on the message
// only if it is visible in our conversation. if (timer != NO_AUTO_DELETE_TIMER) {
// It will be sent with timer, so it destructs at introducee.
if (visible && timer != NO_AUTO_DELETE_TIMER) {
db.setCleanupTimerDuration(txn, m.getId(), timer); db.setCleanupTimerDuration(txn, m.getId(), timer);
} }
} else { } else {
@@ -156,17 +154,15 @@ abstract class AbstractProtocolEngine<S extends Session<?>>
Message m; Message m;
ContactId c = getContactId(txn, s.getContactGroupId()); ContactId c = getContactId(txn, s.getContactGroupId());
if (contactSupportsAutoDeletion(txn, c)) { if (contactSupportsAutoDeletion(txn, c)) {
long timer = long timer = autoDeleteManager.getAutoDeleteTimer(txn, c,
autoDeleteManager.getAutoDeleteTimer(txn, c, timestamp); timestamp);
m = messageEncoder.encodeDeclineMessage(s.getContactGroupId(), m = messageEncoder.encodeDeclineMessage(s.getContactGroupId(),
timestamp, s.getLastLocalMessageId(), s.getSessionId(), timestamp, s.getLastLocalMessageId(), s.getSessionId(),
timer); timer);
sendMessage(txn, DECLINE, s.getSessionId(), m, visible, timer, sendMessage(txn, DECLINE, s.getSessionId(), m, visible, timer,
isAutoDecline); isAutoDecline);
// Set the auto-delete timer duration on the local message // Set the auto-delete timer duration on the local message
// only if it is visible in our conversation. if (timer != NO_AUTO_DELETE_TIMER) {
// It will be sent with timer, so it destructs at introducee.
if (visible && timer != NO_AUTO_DELETE_TIMER) {
db.setCleanupTimerDuration(txn, m.getId(), timer); db.setCleanupTimerDuration(txn, m.getId(), timer);
} }
if (isAutoDecline) { if (isAutoDecline) {