mirror of
https://github.com/markqvist/Reticulum.git
synced 2024-11-26 15:30:18 +00:00
Added default app data to destinations
This commit is contained in:
parent
8800a6ab4e
commit
bdf1d289b0
@ -94,6 +94,7 @@ class Destination:
|
|||||||
self.name = Destination.full_name(app_name, *aspects)
|
self.name = Destination.full_name(app_name, *aspects)
|
||||||
self.hash = Destination.hash(app_name, *aspects)
|
self.hash = Destination.hash(app_name, *aspects)
|
||||||
self.hexhash = self.hash.hex()
|
self.hexhash = self.hash.hex()
|
||||||
|
self.default_app_data = None
|
||||||
|
|
||||||
self.callback = None
|
self.callback = None
|
||||||
self.proofcallback = None
|
self.proofcallback = None
|
||||||
@ -217,6 +218,11 @@ class Destination:
|
|||||||
else:
|
else:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
def set_default_app_data(self, app_data=None):
|
||||||
|
self.default_app_data = app_data
|
||||||
|
|
||||||
|
def clear_default_app_data(self):
|
||||||
|
self.set_default_app_data(app_data=None)
|
||||||
|
|
||||||
# Creates an announce packet for this destination.
|
# Creates an announce packet for this destination.
|
||||||
# Application specific data can be added to the announce.
|
# Application specific data can be added to the announce.
|
||||||
@ -224,6 +230,9 @@ class Destination:
|
|||||||
destination_hash = self.hash
|
destination_hash = self.hash
|
||||||
random_hash = RNS.Identity.getRandomHash()
|
random_hash = RNS.Identity.getRandomHash()
|
||||||
|
|
||||||
|
if app_data == None and self.default_app_data != None:
|
||||||
|
app_data = self.default_app_data
|
||||||
|
|
||||||
signed_data = self.hash+self.identity.getPublicKey()+random_hash
|
signed_data = self.hash+self.identity.getPublicKey()+random_hash
|
||||||
if app_data != None:
|
if app_data != None:
|
||||||
signed_data += app_data
|
signed_data += app_data
|
||||||
|
Loading…
Reference in New Issue
Block a user