mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-14 19:59:05 +01:00
Contact aliases: address review comments
This commit is contained in:
@@ -421,19 +421,14 @@ class IntroductionManagerImpl extends ConversationClientImpl
|
||||
if (ss == null) throw new AssertionError();
|
||||
MessageType type = meta.getMessageType();
|
||||
if (type == REQUEST) {
|
||||
messages.add(
|
||||
parseInvitationRequest(txn, contactGroupId, m,
|
||||
meta, status, ss.bdfSession, authorInfos));
|
||||
messages.add(parseInvitationRequest(txn, contactGroupId, m,
|
||||
meta, status, ss.bdfSession, authorInfos));
|
||||
} else if (type == ACCEPT) {
|
||||
messages.add(
|
||||
parseInvitationResponse(txn, contactGroupId, m,
|
||||
meta, status, ss.bdfSession, authorInfos,
|
||||
true));
|
||||
messages.add(parseInvitationResponse(txn, contactGroupId, m,
|
||||
meta, status, ss.bdfSession, authorInfos, true));
|
||||
} else if (type == DECLINE) {
|
||||
messages.add(
|
||||
parseInvitationResponse(txn, contactGroupId, m,
|
||||
meta, status, ss.bdfSession, authorInfos,
|
||||
false));
|
||||
messages.add(parseInvitationResponse(txn, contactGroupId, m,
|
||||
meta, status, ss.bdfSession, authorInfos, false));
|
||||
}
|
||||
}
|
||||
return messages;
|
||||
|
||||
@@ -174,6 +174,10 @@ public class TestDataCreatorImpl implements TestDataCreator {
|
||||
ContactId contactId = contactManager
|
||||
.addContact(txn, author, localAuthorId, secretKey,
|
||||
timestamp, true, verified, true);
|
||||
if (random.nextBoolean()) {
|
||||
contactManager
|
||||
.setContactAlias(txn, contactId, getRandomAuthorName());
|
||||
}
|
||||
transportPropertyManager.addRemoteProperties(txn, contactId, props);
|
||||
contact = db.getContact(txn, contactId);
|
||||
db.commitTransaction(txn);
|
||||
@@ -202,10 +206,13 @@ public class TestDataCreatorImpl implements TestDataCreator {
|
||||
return authorFactory.createLocalAuthor(name, publicKey, privateKey);
|
||||
}
|
||||
|
||||
private LocalAuthor getRandomAuthor() {
|
||||
private String getRandomAuthorName() {
|
||||
int i = random.nextInt(AUTHOR_NAMES.length);
|
||||
String authorName = AUTHOR_NAMES[i];
|
||||
return getAuthor(authorName);
|
||||
return AUTHOR_NAMES[i];
|
||||
}
|
||||
|
||||
private LocalAuthor getRandomAuthor() {
|
||||
return getAuthor(getRandomAuthorName());
|
||||
}
|
||||
|
||||
private SecretKey getSecretKey() {
|
||||
|
||||
Reference in New Issue
Block a user