diff --git a/src/snek/view/rpc.py b/src/snek/view/rpc.py index deb4286..b164c2c 100644 --- a/src/snek/view/rpc.py +++ b/src/snek/view/rpc.py @@ -127,8 +127,9 @@ class RPCView(BaseView): result = await method(*args) except Exception as ex: result = {"exception": str(ex), "traceback": traceback.format_exc()} - success = False - await self._send_json({"callId": call_id, "success": success, "data": result}) + success = False + if result != "noresponse": + await self._send_json({"callId": call_id, "success": success, "data": result}) except Exception as ex: await self._send_json({"callId": call_id, "success": False, "data": str(ex)}) @@ -141,6 +142,9 @@ class RPCView(BaseView): return [dict(uid=record['uid'],username=record['username'], nick=record['nick'],last_ping=record['last_ping']) async for record in self.services.channel.get_online_users(channel_uid)] + async def echo(self, obj): + await self.ws.send_json(obj) + return "noresponse" async def get_users(self, channel_uid): self._require_login()