Commit 5aeee9af authored by Torsten Grote's avatar Torsten Grote

[core] address review comments for message deletion explanation

parent ae0fa351
Pipeline #3916 passed with stage
in 10 minutes and 15 seconds
......@@ -899,17 +899,15 @@ public class ConversationActivity extends BriarActivity
StringBuilder msg = new StringBuilder();
// get failures the user can not immediately prevent
StringBuilder fails = new StringBuilder();
if (result.hasSessionInProgress()) {
if (result.hasIntroduction()) {
String s = getString(
R.string.dialog_message_not_deleted_ongoing_introductions);
fails.append(s).append("\n");
}
if (result.hasInvitation()) {
String s = getString(
R.string.dialog_message_not_deleted_ongoing_invitations);
fails.append(s).append("\n");
}
if (result.hasIntroductionSessionInProgress()) {
String s = getString(
R.string.dialog_message_not_deleted_ongoing_introductions);
fails.append(s).append("\n");
}
if (result.hasInvitationSessionInProgress()) {
String s = getString(
R.string.dialog_message_not_deleted_ongoing_invitations);
fails.append(s).append("\n");
}
if (result.hasNotFullyDownloaded()) {
String s = getString(
......@@ -923,7 +921,8 @@ public class ConversationActivity extends BriarActivity
msg.append(s);
}
// add problems the user can resolve
if (result.hasNotAllSelected()) {
if (result.hasNotAllIntroductionSelected() ||
result.hasNotAllInvitationSelected()) {
if (msg.length() > 0) msg.append("\n\n");
String s = getString(
R.string.dialog_message_not_deleted_not_all_selected);
......
......@@ -17,10 +17,10 @@ import java.util.Set;
@NotNullByDefault
public interface ConversationManager {
int DELETE_SESSION_IS_INTRODUCTION = 1;
int DELETE_SESSION_IS_INVITATION = 1 << 1;
int DELETE_SESSION_INCOMPLETE = 1 << 2;
int DELETE_SESSION_IN_PROGRESS = 1 << 3;
int DELETE_SESSION_INTRODUCTION_INCOMPLETE = 1;
int DELETE_SESSION_INVITATION_INCOMPLETE = 1 << 1;
int DELETE_SESSION_INTRODUCTION_IN_PROGRESS = 1 << 2;
int DELETE_SESSION_INVITATION_IN_PROGRESS = 1 << 3;
int DELETE_NOT_DOWNLOADED = 1 << 4;
/**
......
......@@ -5,10 +5,10 @@ import org.briarproject.bramble.api.nullsafety.NotNullByDefault;
import javax.annotation.concurrent.NotThreadSafe;
import static org.briarproject.briar.api.conversation.ConversationManager.DELETE_NOT_DOWNLOADED;
import static org.briarproject.briar.api.conversation.ConversationManager.DELETE_SESSION_INCOMPLETE;
import static org.briarproject.briar.api.conversation.ConversationManager.DELETE_SESSION_IN_PROGRESS;
import static org.briarproject.briar.api.conversation.ConversationManager.DELETE_SESSION_IS_INTRODUCTION;
import static org.briarproject.briar.api.conversation.ConversationManager.DELETE_SESSION_IS_INVITATION;
import static org.briarproject.briar.api.conversation.ConversationManager.DELETE_SESSION_INTRODUCTION_INCOMPLETE;
import static org.briarproject.briar.api.conversation.ConversationManager.DELETE_SESSION_INTRODUCTION_IN_PROGRESS;
import static org.briarproject.briar.api.conversation.ConversationManager.DELETE_SESSION_INVITATION_INCOMPLETE;
import static org.briarproject.briar.api.conversation.ConversationManager.DELETE_SESSION_INVITATION_IN_PROGRESS;
@NotThreadSafe
@NotNullByDefault
......@@ -21,19 +21,19 @@ public class DeletionResult {
}
public void addInvitationNotAllSelected() {
result |= DELETE_SESSION_INCOMPLETE | DELETE_SESSION_IS_INVITATION;
result |= DELETE_SESSION_INVITATION_INCOMPLETE;
}
public void addInvitationSessionInProgress() {
result |= DELETE_SESSION_IN_PROGRESS | DELETE_SESSION_IS_INVITATION;
result |= DELETE_SESSION_INVITATION_IN_PROGRESS;
}
public void addIntroductionNotAllSelected() {
result |= DELETE_SESSION_INCOMPLETE | DELETE_SESSION_IS_INTRODUCTION;
result |= DELETE_SESSION_INTRODUCTION_INCOMPLETE;
}
public void addIntroductionSessionInProgress() {
result |= DELETE_SESSION_IN_PROGRESS | DELETE_SESSION_IS_INTRODUCTION;
result |= DELETE_SESSION_INTRODUCTION_IN_PROGRESS;
}
public void addNotFullyDownloaded() {
......@@ -44,20 +44,20 @@ public class DeletionResult {
return result == 0;
}
public boolean hasIntroduction() {
return (result & DELETE_SESSION_IS_INTRODUCTION) != 0;
public boolean hasIntroductionSessionInProgress() {
return (result & DELETE_SESSION_INTRODUCTION_IN_PROGRESS) != 0;
}
public boolean hasInvitation() {
return (result & DELETE_SESSION_IS_INVITATION) != 0;
public boolean hasInvitationSessionInProgress() {
return (result & DELETE_SESSION_INVITATION_IN_PROGRESS) != 0;
}
public boolean hasSessionInProgress() {
return (result & DELETE_SESSION_IN_PROGRESS) != 0;
public boolean hasNotAllIntroductionSelected() {
return (result & DELETE_SESSION_INTRODUCTION_INCOMPLETE) != 0;
}
public boolean hasNotAllSelected() {
return (result & DELETE_SESSION_INCOMPLETE) != 0;
public boolean hasNotAllInvitationSelected() {
return (result & DELETE_SESSION_INVITATION_INCOMPLETE) != 0;
}
public boolean hasNotFullyDownloaded() {
......
......@@ -695,7 +695,6 @@ class IntroductionManagerImpl extends ConversationClientImpl
result.addIntroductionSessionInProgress();
if (!selected.contains(m))
result.addIntroductionNotAllSelected();
break;
}
}
// delete messages of session, if all were ACKed
......
......@@ -756,7 +756,6 @@ class GroupInvitationManagerImpl extends ConversationClientImpl
result.addInvitationSessionInProgress();
if (checker.causesProblem(m))
result.addInvitationNotAllSelected();
break;
}
}
if (sessionDeletable) {
......
......@@ -677,7 +677,6 @@ abstract class SharingManagerImpl<S extends Shareable>
result.addInvitationSessionInProgress();
if (checker.causesProblem(m))
result.addInvitationNotAllSelected();
break;
}
}
if (sessionDeletable) {
......
......@@ -1154,12 +1154,10 @@ public class IntroductionIntegrationTest
// introducer can not yet remove messages
assertFalse(deleteAllMessages1From0().allDeleted());
assertTrue(deleteAllMessages1From0().hasIntroduction());
assertTrue(deleteAllMessages1From0().hasSessionInProgress());
assertTrue(deleteAllMessages1From0().hasIntroductionSessionInProgress());
// introducee1 can not yet remove messages
assertFalse(deleteAllMessages0From1().allDeleted());
assertTrue(deleteAllMessages0From1().hasIntroduction());
assertTrue(deleteAllMessages0From1().hasSessionInProgress());
assertTrue(deleteAllMessages0From1().hasIntroductionSessionInProgress());
// sync second REQUEST message
sync0To2(1, true);
......@@ -1167,10 +1165,10 @@ public class IntroductionIntegrationTest
// introducer can not yet remove messages
assertFalse(deleteAllMessages2From0().allDeleted());
assertTrue(deleteAllMessages2From0().hasSessionInProgress());
assertTrue(deleteAllMessages2From0().hasIntroductionSessionInProgress());
// introducee2 can not yet remove messages
assertFalse(deleteAllMessages0From2().allDeleted());
assertTrue(deleteAllMessages0From2().hasSessionInProgress());
assertTrue(deleteAllMessages0From2().hasIntroductionSessionInProgress());
// sync first ACCEPT message
sync1To0(1, true);
......@@ -1178,7 +1176,7 @@ public class IntroductionIntegrationTest
// introducer can not yet remove messages
assertFalse(deleteAllMessages1From0().allDeleted());
assertTrue(deleteAllMessages1From0().hasSessionInProgress());
assertTrue(deleteAllMessages1From0().hasIntroductionSessionInProgress());
// sync second ACCEPT message
sync2To0(1, true);
......@@ -1186,7 +1184,7 @@ public class IntroductionIntegrationTest
// introducer can not yet remove messages
assertFalse(deleteAllMessages2From0().allDeleted());
assertTrue(deleteAllMessages2From0().hasSessionInProgress());
assertTrue(deleteAllMessages2From0().hasIntroductionSessionInProgress());
// sync forwarded ACCEPT messages to introducees
sync0To1(1, true);
......@@ -1194,10 +1192,10 @@ public class IntroductionIntegrationTest
// introducee1 can not yet remove messages
assertFalse(deleteAllMessages0From1().allDeleted());
assertTrue(deleteAllMessages0From1().hasSessionInProgress());
assertTrue(deleteAllMessages0From1().hasIntroductionSessionInProgress());
// introducee2 can not yet remove messages
assertFalse(deleteAllMessages0From2().allDeleted());
assertTrue(deleteAllMessages0From2().hasSessionInProgress());
assertTrue(deleteAllMessages0From2().hasIntroductionSessionInProgress());
// sync first AUTH and its forward
sync1To0(1, true);
......@@ -1205,12 +1203,12 @@ public class IntroductionIntegrationTest
// introducer can not yet remove messages
assertFalse(deleteAllMessages1From0().allDeleted());
assertTrue(deleteAllMessages1From0().hasSessionInProgress());
assertTrue(deleteAllMessages1From0().hasIntroductionSessionInProgress());
assertFalse(deleteAllMessages2From0().allDeleted());
assertTrue(deleteAllMessages2From0().hasSessionInProgress());
assertTrue(deleteAllMessages2From0().hasIntroductionSessionInProgress());
// introducee2 can not yet remove messages
assertFalse(deleteAllMessages0From2().allDeleted());
assertTrue(deleteAllMessages0From2().hasSessionInProgress());
assertTrue(deleteAllMessages0From2().hasIntroductionSessionInProgress());
// sync second AUTH and its forward as well as the following ACTIVATE
sync2To0(2, true);
......@@ -1218,12 +1216,12 @@ public class IntroductionIntegrationTest
// introducer can not yet remove messages
assertFalse(deleteAllMessages1From0().allDeleted());
assertTrue(deleteAllMessages1From0().hasSessionInProgress());
assertTrue(deleteAllMessages1From0().hasIntroductionSessionInProgress());
assertFalse(deleteAllMessages2From0().allDeleted());
assertTrue(deleteAllMessages2From0().hasSessionInProgress());
assertTrue(deleteAllMessages2From0().hasIntroductionSessionInProgress());
// introducee1 can not yet remove messages
assertFalse(deleteAllMessages0From1().allDeleted());
assertTrue(deleteAllMessages0From1().hasSessionInProgress());
assertTrue(deleteAllMessages0From1().hasIntroductionSessionInProgress());
// sync second ACTIVATE and its forward
sync1To0(1, true);
......@@ -1245,8 +1243,9 @@ public class IntroductionIntegrationTest
assertGroupCount(messageTracker0, g1.getId(), 0, 0);
// introducee1 can not yet remove messages, because last not ACKed
assertFalse(deleteAllMessages0From1().allDeleted());
assertTrue(deleteAllMessages0From1().hasSessionInProgress());
DeletionResult result = deleteAllMessages0From1();
assertFalse(result.allDeleted());
assertTrue(result.hasIntroductionSessionInProgress());
assertEquals(2, getMessages0From1().size());
// check that introducee1 messages are tracked properly
......@@ -1292,14 +1291,18 @@ public class IntroductionIntegrationTest
assertFalse(listener2.aborted);
// nobody can delete anything again
assertFalse(deleteAllMessages1From0().allDeleted());
assertTrue(deleteAllMessages1From0().hasSessionInProgress());
assertFalse(deleteAllMessages2From0().allDeleted());
assertTrue(deleteAllMessages2From0().hasSessionInProgress());
assertFalse(deleteAllMessages0From1().allDeleted());
assertTrue(deleteAllMessages0From1().hasSessionInProgress());
assertFalse(deleteAllMessages0From2().allDeleted());
assertTrue(deleteAllMessages0From2().hasSessionInProgress());
result = deleteAllMessages1From0();
assertFalse(result.allDeleted());
assertTrue(result.hasIntroductionSessionInProgress());
result = deleteAllMessages2From0();
assertFalse(result.allDeleted());
assertTrue(result.hasIntroductionSessionInProgress());
result = deleteAllMessages0From1();
assertFalse(result.allDeleted());
assertTrue(result.hasIntroductionSessionInProgress());
result = deleteAllMessages0From2();
assertFalse(result.allDeleted());
assertTrue(result.hasIntroductionSessionInProgress());
// group counts get counted up again correctly
assertGroupCount(messageTracker0, g1.getId(), 2, 1);
......@@ -1485,8 +1488,7 @@ public class IntroductionIntegrationTest
Set<MessageId> toDelete1 = new HashSet<>();
toDelete1.add(messageId1);
assertFalse(deleteMessages1From0(toDelete1).allDeleted());
assertTrue(deleteMessages1From0(toDelete1).hasIntroduction());
assertTrue(deleteMessages1From0(toDelete1).hasSessionInProgress());
assertTrue(deleteMessages1From0(toDelete1).hasIntroductionSessionInProgress());
// deleting the introduction for introducee2 will fail as well
Collection<ConversationMessageHeader> m2From0 = getMessages2From0();
......@@ -1495,8 +1497,7 @@ public class IntroductionIntegrationTest
Set<MessageId> toDelete2 = new HashSet<>();
toDelete2.add(messageId2);
assertFalse(deleteMessages2From0(toDelete2).allDeleted());
assertTrue(deleteMessages2From0(toDelete2).hasIntroduction());
assertTrue(deleteMessages2From0(toDelete2).hasSessionInProgress());
assertTrue(deleteMessages2From0(toDelete2).hasIntroductionSessionInProgress());
// sync REQUEST messages
sync0To1(1, true);
......@@ -1506,9 +1507,9 @@ public class IntroductionIntegrationTest
// deleting introduction fails, because responses did not arrive
assertFalse(deleteMessages0From1(toDelete1).allDeleted());
assertTrue(deleteMessages0From1(toDelete1).hasSessionInProgress());
assertTrue(deleteMessages0From1(toDelete1).hasIntroductionSessionInProgress());
assertFalse(deleteMessages0From2(toDelete2).allDeleted());
assertTrue(deleteMessages0From2(toDelete2).hasSessionInProgress());
assertTrue(deleteMessages0From2(toDelete2).hasIntroductionSessionInProgress());
// remember response of introducee1 for future deletion
Collection<ConversationMessageHeader> m0From1 = getMessages0From1();
......@@ -1568,8 +1569,7 @@ public class IntroductionIntegrationTest
// deleting introduction fails for introducee 2,
// because response is not yet selected for deletion
assertFalse(deleteMessages0From2(toDelete2).allDeleted());
assertTrue(deleteMessages0From2(toDelete2).hasIntroduction());
assertTrue(deleteMessages0From2(toDelete2).hasNotAllSelected());
assertTrue(deleteMessages0From2(toDelete2).hasNotAllIntroductionSelected());
// add response to be deleted as well
toDelete2.add(response2);
......@@ -1587,8 +1587,7 @@ public class IntroductionIntegrationTest
// deleting introduction fails for introducee 1,
// because response is not yet selected for deletion
assertFalse(deleteMessages0From1(toDelete1).allDeleted());
assertTrue(deleteMessages0From1(toDelete1).hasIntroduction());
assertTrue(deleteMessages0From1(toDelete1).hasNotAllSelected());
assertTrue(deleteMessages0From1(toDelete1).hasNotAllIntroductionSelected());
// add response to be deleted as well
toDelete1.add(response1);
......
......@@ -280,38 +280,30 @@ public class MessagingManagerIntegrationTest
PrivateMessage m =
sendMessage(c0, c1, getRandomString(42), singletonList(h));
// attachment exists on both devices, state is set to PENDING
db0.transaction(false, txn -> {
db0.getMessage(txn, h.getMessageId());
db0.setMessageState(txn, h.getMessageId(), PENDING);
});
// attachment exists on both devices, state set to PENDING for receiver
db1.transaction(false, txn -> {
db1.getMessage(txn, h.getMessageId());
db1.setMessageState(txn, h.getMessageId(), PENDING);
});
// deleting message fails (on both sides),
// because attachment is not yet delivered
// deleting succeeds for sender
Set<MessageId> toDelete = singleton(m.getMessage().getId());
DeletionResult result0 = db0.transactionWithResult(false, txn ->
messagingManager0.deleteMessages(txn, contactId, toDelete));
assertFalse(result0.allDeleted());
assertTrue(result0.hasNotFullyDownloaded());
assertTrue(result0.allDeleted());
// deleting message fails for receiver,
// because attachment is not yet delivered
DeletionResult result1 = db1.transactionWithResult(false, txn ->
messagingManager1.deleteMessages(txn, contactId, toDelete));
assertFalse(result1.allDeleted());
assertTrue(result1.hasNotFullyDownloaded());
// deliver attachment
db0.transaction(false,
txn -> db0.setMessageState(txn, h.getMessageId(), DELIVERED));
db1.transaction(false,
txn -> db1.setMessageState(txn, h.getMessageId(), DELIVERED));
// deleting message and attachment on both sides works now
assertTrue(db0.transactionWithResult(false, txn ->
messagingManager0.deleteMessages(txn, contactId, toDelete))
.allDeleted());
// deleting message and attachment works for sender now
assertTrue(db1.transactionWithResult(false, txn ->
messagingManager1.deleteMessages(txn, contactId, toDelete))
.allDeleted());
......
......@@ -465,12 +465,10 @@ public class GroupInvitationIntegrationTest
// messages can not be deleted
assertFalse(deleteAllMessages1From0().allDeleted());
assertTrue(deleteAllMessages1From0().hasInvitation());
assertTrue(deleteAllMessages1From0().hasSessionInProgress());
assertTrue(deleteAllMessages1From0().hasInvitationSessionInProgress());
assertEquals(1, getMessages1From0().size());
assertFalse(deleteAllMessages0From1().allDeleted());
assertTrue(deleteAllMessages0From1().hasInvitation());
assertTrue(deleteAllMessages0From1().hasSessionInProgress());
assertTrue(deleteAllMessages0From1().hasInvitationSessionInProgress());
assertEquals(1, getMessages0From1().size());
// respond
......@@ -485,13 +483,13 @@ public class GroupInvitationIntegrationTest
// messages can be deleted now by creator, invitee needs to wait for ACK
assertTrue(deleteAllMessages1From0().allDeleted());
assertEquals(0, getMessages1From0().size());
assertTrue(deleteAllMessages1From0().allDeleted()); // a second time nothing happens
assertTrue(deleteAllMessages1From0()
.allDeleted()); // a second time nothing happens
assertGroupCount(messageTracker0, g1From0.getId(), 0, 0);
// trying to delete fails for invitee
assertFalse(deleteAllMessages0From1().allDeleted());
assertTrue(deleteAllMessages0From1().hasInvitation());
assertTrue(deleteAllMessages0From1().hasSessionInProgress());
assertTrue(deleteAllMessages0From1().hasInvitationSessionInProgress());
assertEquals(2, getMessages0From1().size());
// creator sends two JOIN messages (one sharing + one in private group)
......@@ -539,8 +537,7 @@ public class GroupInvitationIntegrationTest
// trying to delete fails for invitee
assertFalse(deleteAllMessages0From1().allDeleted());
assertTrue(deleteAllMessages0From1().hasInvitation());
assertTrue(deleteAllMessages0From1().hasSessionInProgress());
assertTrue(deleteAllMessages0From1().hasInvitationSessionInProgress());
assertEquals(2, getMessages0From1().size());
// creator sends ACK
......@@ -559,9 +556,9 @@ public class GroupInvitationIntegrationTest
// now new messages can not be deleted anymore
assertFalse(deleteAllMessages1From0().allDeleted());
assertTrue(deleteAllMessages1From0().hasSessionInProgress());
assertTrue(deleteAllMessages1From0().hasInvitationSessionInProgress());
assertFalse(deleteAllMessages0From1().allDeleted());
assertTrue(deleteAllMessages0From1().hasSessionInProgress());
assertTrue(deleteAllMessages0From1().hasInvitationSessionInProgress());
// responding again
groupInvitationManager1
......@@ -595,9 +592,11 @@ public class GroupInvitationIntegrationTest
Set<MessageId> toDelete = new HashSet<>();
toDelete.add(messageId);
assertFalse(deleteMessages1From0(toDelete).allDeleted());
assertTrue(deleteMessages1From0(toDelete).hasSessionInProgress());
assertTrue(deleteMessages1From0(toDelete)
.hasInvitationSessionInProgress());
assertFalse(deleteMessages0From1(toDelete).allDeleted());
assertTrue(deleteMessages0From1(toDelete).hasSessionInProgress());
assertTrue(deleteMessages0From1(toDelete)
.hasInvitationSessionInProgress());
// respond
groupInvitationManager1
......@@ -607,9 +606,11 @@ public class GroupInvitationIntegrationTest
// both can still not delete the invitation,
// because the response was not selected for deletion as well
assertFalse(deleteMessages1From0(toDelete).allDeleted());
assertTrue(deleteMessages1From0(toDelete).hasNotAllSelected());
assertTrue(
deleteMessages1From0(toDelete).hasNotAllInvitationSelected());
assertFalse(deleteMessages0From1(toDelete).allDeleted());
assertTrue(deleteMessages0From1(toDelete).hasNotAllSelected());
assertTrue(
deleteMessages0From1(toDelete).hasNotAllInvitationSelected());
// after selecting response, both messages can be deleted by creator
m0 = getMessages1From0();
......@@ -626,7 +627,8 @@ public class GroupInvitationIntegrationTest
// 1 can still not delete the messages, as last one has not been ACKed
assertFalse(deleteMessages0From1(toDelete).allDeleted());
assertTrue(deleteMessages0From1(toDelete).hasSessionInProgress());
assertTrue(deleteMessages0From1(toDelete)
.hasInvitationSessionInProgress());
assertEquals(2, getMessages0From1().size());
assertGroupCount(messageTracker1, g0From1.getId(), 2, 1);
......
......@@ -866,11 +866,9 @@ public class ForumSharingIntegrationTest
// messages can not be deleted
assertFalse(deleteAllMessages1From0().allDeleted());
assertTrue(deleteAllMessages1From0().hasInvitation());
assertTrue(deleteAllMessages1From0().hasSessionInProgress());
assertTrue(deleteAllMessages1From0().hasInvitationSessionInProgress());
assertFalse(deleteAllMessages0From1().allDeleted());
assertTrue(deleteAllMessages0From1().hasInvitation());
assertTrue(deleteAllMessages0From1().hasSessionInProgress());
assertTrue(deleteAllMessages0From1().hasInvitationSessionInProgress());
// accept invitation
respondToRequest(contactId0From1, true);
......@@ -892,7 +890,7 @@ public class ForumSharingIntegrationTest
// 1 can not delete all messages, as last one has not been ACKed
assertFalse(deleteAllMessages0From1().allDeleted());
assertTrue(deleteAllMessages0From1().hasSessionInProgress());
assertTrue(deleteAllMessages0From1().hasInvitationSessionInProgress());
assertGroupCount(messageTracker1, g0From1, 2, 1);
// 0 sends an ACK to their last message
......@@ -918,11 +916,11 @@ public class ForumSharingIntegrationTest
// messages can not be deleted anymore
assertFalse(deleteAllMessages1From0().allDeleted());
assertTrue(deleteAllMessages1From0().hasSessionInProgress());
assertTrue(deleteAllMessages1From0().hasInvitationSessionInProgress());
assertEquals(1, getMessages1From0().size());
assertGroupCount(messageTracker0, g1From0, 1, 1);
assertFalse(deleteAllMessages0From1().allDeleted());
assertTrue(deleteAllMessages0From1().hasSessionInProgress());
assertTrue(deleteAllMessages0From1().hasInvitationSessionInProgress());
assertEquals(1, getMessages0From1().size());
assertGroupCount(messageTracker1, g0From1, 1, 0);
......@@ -998,8 +996,7 @@ public class ForumSharingIntegrationTest
Set<MessageId> toDelete = new HashSet<>();
toDelete.add(messageId);
assertFalse(deleteMessages1From0(toDelete).allDeleted());
assertTrue(deleteMessages1From0(toDelete).hasInvitation());
assertTrue(deleteMessages1From0(toDelete).hasSessionInProgress());
assertTrue(deleteMessages1From0(toDelete).hasInvitationSessionInProgress());
// decline invitation
respondToRequest(contactId0From1, true);
......@@ -1009,11 +1006,9 @@ public class ForumSharingIntegrationTest
// both can still not delete the invitation,
// because the response was not selected for deletion as well
assertFalse(deleteMessages1From0(toDelete).allDeleted());
assertTrue(deleteMessages1From0(toDelete).hasInvitation());
assertTrue(deleteMessages1From0(toDelete).hasNotAllSelected());
assertTrue(deleteMessages1From0(toDelete).hasNotAllInvitationSelected());
assertFalse(deleteMessages0From1(toDelete).allDeleted());
assertTrue(deleteMessages0From1(toDelete).hasInvitation());
assertTrue(deleteMessages0From1(toDelete).hasNotAllSelected());
assertTrue(deleteMessages0From1(toDelete).hasNotAllInvitationSelected());
// after selecting response, both messages can be deleted
m0 = getMessages1From0();
......@@ -1028,9 +1023,8 @@ public class ForumSharingIntegrationTest
// 1 can still not delete the messages, as last one has not been ACKed
assertFalse(deleteMessages0From1(toDelete).allDeleted());
assertFalse(deleteMessages0From1(toDelete).hasNotAllSelected());
assertTrue(deleteMessages0From1(toDelete).hasInvitation());
assertTrue(deleteMessages0From1(toDelete).hasSessionInProgress());
assertFalse(deleteMessages0From1(toDelete).hasNotAllInvitationSelected());
assertTrue(deleteMessages0From1(toDelete).hasInvitationSessionInProgress());
// 0 sends an ACK to their last message
sendAcks(c0, c1, contactId1From0, 1);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment