Chans should now work.
Other deterministic addresses should be easy to implement, but aren't done yet
This commit is contained in:
@ -116,6 +116,7 @@ public class BitmessageContext {
|
||||
|
||||
public BitmessageAddress joinChan(String passphrase, String address) {
|
||||
BitmessageAddress chan = BitmessageAddress.chan(address, passphrase);
|
||||
chan.setAlias(passphrase);
|
||||
ctx.getAddressRepository().save(chan);
|
||||
return chan;
|
||||
}
|
||||
|
@ -73,7 +73,7 @@ class DefaultMessageListener implements NetworkHandler.MessageListener {
|
||||
|
||||
protected void receive(ObjectMessage object, GetPubkey getPubkey) {
|
||||
BitmessageAddress identity = ctx.getAddressRepository().findIdentity(getPubkey.getRipeTag());
|
||||
if (identity != null && identity.getPrivateKey() != null) {
|
||||
if (identity != null && identity.getPrivateKey() != null && !identity.isChan()) {
|
||||
LOG.info("Got pubkey request for identity " + identity);
|
||||
// FIXME: only send pubkey if it wasn't sent in the last 28 days
|
||||
ctx.sendPubkey(identity, object.getStream());
|
||||
|
@ -247,4 +247,8 @@ public class BitmessageAddress implements Serializable {
|
||||
public boolean isChan() {
|
||||
return chan;
|
||||
}
|
||||
|
||||
public void setChan(boolean chan) {
|
||||
this.chan = chan;
|
||||
}
|
||||
}
|
||||
|
@ -30,12 +30,17 @@ public interface AddressRepository {
|
||||
*/
|
||||
List<BitmessageAddress> getIdentities();
|
||||
|
||||
/**
|
||||
* @return all subscribed chans.
|
||||
*/
|
||||
List<BitmessageAddress> getChans();
|
||||
|
||||
List<BitmessageAddress> getSubscriptions();
|
||||
|
||||
List<BitmessageAddress> getSubscriptions(long broadcastVersion);
|
||||
|
||||
/**
|
||||
* @return all Bitmessage addresses that have no private key.
|
||||
* @return all Bitmessage addresses that have no private key or are chans.
|
||||
*/
|
||||
List<BitmessageAddress> getContacts();
|
||||
|
||||
|
Reference in New Issue
Block a user