def Account(self, acc_event, context): action = None if acc_event.action == pb.CREATE: action = "created" elif acc_event.action == pb.UPDATE: action = "updated" elif acc_event.action == pb.DELETE: action = "deleted" else: action = "unknown" print("Account", action, ":", acc_event.user_id, acc_event.public) if action == "created": name = "Ally" # TODO: subscribe to the new user. if hasattr(acc_event.public, 'fn'): name = acc_event.public.fn.decode('utf-8') msq = next_welcome(name) client_post(subscribe(acc_event.user_id)) client_post(publish(acc_event.user_id, msq)) return pb.Unused()
def Account(self, acc_event, context): action = None if acc_event.action == pb.Crud.CREATE: action = "created" elif acc_event.action == pb.Crud.UPDATE: action = "updated" elif acc_event.action == pb.Crud.DELETE: action = "deleted" else: action = "unknown" print "Account", action, ":", acc_event.user_id, acc_event.public return pb.Unused()
def Account(self, acc_event, context): action = None if acc_event.action == pb.CREATE: action = "created" elif acc_event.action == pb.UPDATE: action = "updated" elif acc_event.action == pb.DELETE: action = "deleted" else: action = "unknown" print("Account", action, ":", acc_event.user_id, acc_event.public) # TODO: subscribe to the new user. return pb.Unused()