diff options
Diffstat (limited to 'lib/nickserver/hkp/parse_key_info.rb')
-rw-r--r-- | lib/nickserver/hkp/parse_key_info.rb | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/nickserver/hkp/parse_key_info.rb b/lib/nickserver/hkp/parse_key_info.rb index 9d59d6b..2f928a0 100644 --- a/lib/nickserver/hkp/parse_key_info.rb +++ b/lib/nickserver/hkp/parse_key_info.rb @@ -19,7 +19,8 @@ module Nickserver; module Hkp @vindex_result = vindex_result end - def status_for(uid) + def status_for(email) + uid = email.to_s if hkp_ok? && keys(uid).empty? error_status(uid) else @@ -27,7 +28,8 @@ module Nickserver; module Hkp end end - def response_for(uid) + def response_for(email) + uid = email.to_s if keys(uid).any? keys(uid) else @@ -35,6 +37,8 @@ module Nickserver; module Hkp end end + protected + def keys(uid) key_infos(uid).reject { |key| error_for_key(key) } end @@ -47,8 +51,6 @@ module Nickserver; module Hkp end end - protected - attr_reader :status attr_reader :vindex_result |