Contact aliases: address review comments

This commit is contained in:
Torsten Grote
2018-10-31 12:05:33 -03:00
parent ecf417c93b
commit 3fe7aae97e
8 changed files with 44 additions and 24 deletions

View File

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

View File

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