authd/src/requests/contact.cr

16 lines
380 B
Crystal
Raw Normal View History

2020-11-22 13:49:34 +01:00
class AuthD::Request
IPC::JSON.message GetContacts, 18 do
def initialize()
2020-11-22 13:49:34 +01:00
end
def handle(authd : AuthD::Service, fd : Int32)
logged_user = authd.get_logged_user_full? fd
return Response::Error.new "you must be logged" if logged_user.nil?
2020-11-22 13:49:34 +01:00
_c = logged_user.contact
Response::Contacts.new logged_user.uid, _c.email
2020-11-22 13:49:34 +01:00
end
end
AuthD.requests << GetContacts
end