[core] address review comments for message deletion explanation

This commit is contained in:
Torsten Grote
2019-11-14 13:46:28 -03:00
parent ae0fa351b6
commit 5aeee9af8b
10 changed files with 101 additions and 118 deletions

View File

@@ -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;
/**

View File

@@ -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() {