mirror of
https://github.com/markqvist/LXMF
synced 2026-11-22 23:10:36 +00:00
Added ability to specify delivery destination stamp value at identity registration
This commit is contained in:
3 files changed
+4
-3
No files matched your search
+2
-1
@@ -410,7 +410,7 @@ class LXMRouter:
|
||||
da_thread.setDaemon(True)
|
||||
da_thread.start()
|
||||
|
||||
def register_delivery_identity(self, identity, display_name = None, stamp_cost = None):
|
||||
def register_delivery_identity(self, identity, display_name=None, stamp_cost=None, stamp_value=None):
|
||||
if len(self.delivery_destinations) != 0:
|
||||
RNS.log("Currently only one delivery identity is supported per LXMF router instance", RNS.LOG_ERROR)
|
||||
return None
|
||||
@@ -419,6 +419,7 @@ class LXMRouter:
|
||||
os.makedirs(self.ratchetpath)
|
||||
|
||||
delivery_destination = RNS.Destination(identity, RNS.Destination.IN, RNS.Destination.SINGLE, APP_NAME, "delivery")
|
||||
if stamp_value: delivery_destination.set_value(stamp_value)
|
||||
delivery_destination.set_link_cost(self.DELIVERY_LINK_COST)
|
||||
delivery_destination.enable_ratchets(f"{self.ratchetpath}/{RNS.hexrep(delivery_destination.hash, delimit=False)}.ratchets")
|
||||
delivery_destination.set_packet_callback(self.delivery_packet)
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
__version__ = "1.3.0"
|
||||
__version__ = "1.3.1"
|
||||
Reference in new issue
Block a user