Broadcasts. Receiving seems to work, but there still seems to be a problem with sending them.
This commit is contained in:
@ -19,6 +19,7 @@ package ch.dissem.bitmessage.factory;
|
||||
import ch.dissem.bitmessage.entity.BitmessageAddress;
|
||||
import ch.dissem.bitmessage.entity.NetworkMessage;
|
||||
import ch.dissem.bitmessage.entity.ObjectMessage;
|
||||
import ch.dissem.bitmessage.entity.Plaintext;
|
||||
import ch.dissem.bitmessage.entity.payload.*;
|
||||
import ch.dissem.bitmessage.entity.valueobject.PrivateKey;
|
||||
import org.slf4j.Logger;
|
||||
@ -164,4 +165,12 @@ public class Factory {
|
||||
return GenericPayload.read(version, stream, streamNumber, length);
|
||||
}
|
||||
}
|
||||
|
||||
public static ObjectPayload getBroadcast(BitmessageAddress sendingAddress, Plaintext plaintext) {
|
||||
if (sendingAddress.getVersion() < 4) {
|
||||
return new V4Broadcast(sendingAddress, plaintext);
|
||||
} else {
|
||||
return new V5Broadcast(sendingAddress, plaintext);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user