diff --git a/src/authd.cr b/src/authd.cr index bb68b68..7d5b582 100644 --- a/src/authd.cr +++ b/src/authd.cr @@ -169,12 +169,6 @@ class AuthD::Response end end -class IPC::Context - def send(fd, response : AuthD::Response) - send fd, response.type.to_u8, response.to_json - end -end - class AuthD::Request include JSON::Serializable @@ -370,8 +364,14 @@ class AuthD::Request end class IPC::Context - def send(fd, request : AuthD::Request) - send fd, request.type.to_u8, request.to_json + def send(fd, response : AuthD::Response) + send fd, response.type.to_u8, response.to_json + end +end + +class IPC::Client + def send(request : AuthD::Request) + send @server_fd, request.type.to_u8, request.to_json end end @@ -574,15 +574,3 @@ module AuthD send Request::SearchUser.new user_login response = Response.from_ipc read - case response - when Response::MatchingUsers - response.users - when Response::Error - raise Exception.new response.reason - else - Exception.new - end - end - end -end -