mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-16 04:39:54 +01:00
Give positive ratings to own pseudonyms and contacts' known pseudonyms.
This commit is contained in:
@@ -9,6 +9,7 @@ import static net.sf.briar.api.TransportPropertyConstants.MAX_PROPERTIES_PER_TRA
|
||||
import static net.sf.briar.api.TransportPropertyConstants.MAX_PROPERTY_LENGTH;
|
||||
import static net.sf.briar.api.invitation.InvitationConstants.CONNECTION_TIMEOUT;
|
||||
import static net.sf.briar.api.invitation.InvitationConstants.HASH_LENGTH;
|
||||
import static net.sf.briar.api.messaging.Rating.GOOD;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.security.GeneralSecurityException;
|
||||
@@ -275,13 +276,15 @@ abstract class Connector extends Thread {
|
||||
long epoch, boolean alice) throws DbException {
|
||||
// Add the contact to the database
|
||||
ContactId c = db.addContact(remoteAuthor, localAuthor.getId());
|
||||
// Add a positive rating for the contact's pseudonym
|
||||
db.setRating(remoteAuthor.getId(), GOOD);
|
||||
// Store the remote transport properties
|
||||
db.setRemoteProperties(c, remoteProps);
|
||||
// Create an endpoint for each transport shared with the contact
|
||||
List<TransportId> ids = new ArrayList<TransportId>();
|
||||
for(TransportId id : localProps.keySet())
|
||||
if(remoteProps.containsKey(id)) ids.add(id);
|
||||
// Assign indices to the transports in a deterministic way
|
||||
// Assign indices to the transports deterministically and derive keys
|
||||
Collections.sort(ids, TransportIdComparator.INSTANCE);
|
||||
int size = ids.size();
|
||||
for(int i = 0; i < size; i++) {
|
||||
|
||||
Reference in New Issue
Block a user