Esempio n. 1
0
 def rpc_get_listings(self, sender):
     self.log.info("serving store listings to %s" % sender)
     self.router.addContact(sender)
     try:
         p = Profile(self.db).get()
         l = Listings()
         l.ParseFromString(self.db.ListingsStore().get_proto())
         l.handle = p.handle
         l.avatar_hash = p.avatar_hash
         return [l.SerializeToString(), self.signing_key.sign(l.SerializeToString())[:64]]
     except Exception:
         self.log.warning("could not find any listings in the database")
         return None
Esempio n. 2
0
 def rpc_get_listings(self, sender):
     self.log.info("serving store listings to %s" % sender)
     self.router.addContact(sender)
     try:
         p = Profile(self.db).get()
         l = Listings()
         l.ParseFromString(self.db.ListingsStore().get_proto())
         l.handle = p.handle
         l.avatar_hash = p.avatar_hash
         return [l.SerializeToString(), self.signing_key.sign(l.SerializeToString())[:64]]
     except Exception:
         self.log.warning("could not find any listings in the database")
         return None
Esempio n. 3
0
 def rpc_get_listings(self, sender):
     self.log.info("serving store listings to %s" % sender)
     self.audit.record(sender.id.encode("hex"), "GET_LISTINGS")
     self.router.addContact(sender)
     try:
         p = Profile(self.db).get()
         l = Listings()
         l.ParseFromString(self.db.listings.get_proto())
         l.handle = p.handle
         l.avatar_hash = p.avatar_hash
         for listing in l.listing:
             if listing.hidden:
                 l.listing.remove(listing)
         return [l.SerializeToString(), self.signing_key.sign(l.SerializeToString())[:64]]
     except Exception:
         self.log.warning("could not find any listings in the database")
         return None
Esempio n. 4
0
 def rpc_get_listings(self, sender):
     self.log.info("serving store listings to %s" % sender)
     self.audit.record(sender.id.encode("hex"), "GET_LISTINGS")
     self.router.addContact(sender)
     try:
         p = Profile(self.db).get()
         l = Listings()
         l.ParseFromString(self.db.listings.get_proto())
         l.handle = p.handle
         l.avatar_hash = p.avatar_hash
         for listing in l.listing:
             if listing.hidden:
                 l.listing.remove(listing)
         return [
             l.SerializeToString(),
             self.signing_key.sign(l.SerializeToString())[:64]
         ]
     except Exception:
         self.log.warning("could not find any listings in the database")
         return None