Disallow registration from clients registered on another relay.

This commit is contained in:
Moxie Marlinspike
2014-02-25 17:04:46 -08:00
parent 129e372613
commit a63cdc76b0
2 changed files with 11 additions and 0 deletions

View File

@@ -90,6 +90,13 @@ public class AccountsManager {
else return Optional.absent();
}
public boolean isRelayListed(String number) {
byte[] token = Util.getContactToken(number);
Optional<ClientContact> contact = directory.get(token);
return contact.isPresent() && !Util.isEmpty(contact.get().getRelay());
}
private void updateDirectory(Account account) {
if (account.isActive()) {
byte[] token = Util.getContactToken(account.getNumber());