serverwallet

Unnamed repository; edit this file 'description' to name the repository.
Info | Log | Files | Refs

commit 1b3904fb5ad69348e0dfc4ad7e8bd933f4921a11
parent 2ff6136684c6500792abc6d3bdf235daec029212
Author: lash <dev@holbrook.no>
Date:   Thu, 23 Oct 2025 05:06:50 +0100

Add all contact entries in dict to storage

Diffstat:
Msrvaddrgen/msg.py | 11++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/srvaddrgen/msg.py b/srvaddrgen/msg.py @@ -40,7 +40,12 @@ class Message: if isinstance(v, bytes): v = v.decode('utf-8') o = json.loads(v) - return Message(o['author'], o['content'], contact=o.get('contact')) + contact = o.get('contact') + contacts = [] + if contact != None: + for k in contact.keys(): + contacts.append(Contact(k, contact[k])) + return Message(o['author'], o['content'], contact=contacts) def serialize(self): @@ -50,8 +55,8 @@ class Message: } if self.origin != None: o['o'] = self.origin - if self.contact != None: - o[self.contact.typ()] = self.contact.val() + for v in self.contact: + o[v.typ()] = v.val() return rencode.dumps(o)