Store avatars as binary instead of base64
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -159,6 +159,15 @@ class User < ApplicationRecord
|
||||
@display_name ||= ldap_entry[:display_name]
|
||||
end
|
||||
|
||||
def avatar
|
||||
@avatar ||= LdapManager::FetchAvatar.call(cn: cn)
|
||||
end
|
||||
|
||||
def avatar_base64
|
||||
return nil if avatar.nil?
|
||||
@avatar_base64 ||= Base64.strict_encode64(avatar)
|
||||
end
|
||||
|
||||
def nostr_pubkey
|
||||
@nostr_pubkey ||= ldap_entry[:nostr_key]
|
||||
end
|
||||
@@ -186,10 +195,6 @@ class User < ApplicationRecord
|
||||
ZBase32.encode(Digest::SHA1.digest(cn))
|
||||
end
|
||||
|
||||
def avatar
|
||||
@avatar_base64 ||= LdapManager::FetchAvatar.call(cn: cn)
|
||||
end
|
||||
|
||||
def services_enabled
|
||||
ldap_entry[:services_enabled] || []
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user