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
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
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