Serve avatar locally rather than through Libravatar, it'll perform better and doesn't require the image's size to be messed with
This commit is contained in:
parent
20470aa852
commit
c517baac1c
6 changed files with 3 additions and 11 deletions
|
@ -7,11 +7,6 @@ import Import
|
|||
import Data.Maybe (fromJust)
|
||||
import qualified Data.Map as M
|
||||
import qualified Data.Text as T
|
||||
import qualified Network.Libravatar as L
|
||||
|
||||
libravatar :: (MonadIO m) => User -> m (Maybe Text)
|
||||
libravatar = liftIO . flip L.avatarUrl opts . L.Email . userEmail
|
||||
where opts = def { L.optSecure = True, L.optSize = L.Size 512, L.optTryGravatar = False }
|
||||
|
||||
entityToTuple :: Entity t -> (Key t, t)
|
||||
entityToTuple (Entity key value) = (key, value)
|
||||
|
@ -30,7 +25,6 @@ routeFromPgp PgpKey { pgpKeyFingerprint = f } = staticR ["pgp", T.takeEnd 8 f ++
|
|||
|
||||
hCard :: Entity User -> Widget
|
||||
hCard (Entity userId user) = do
|
||||
maybeAvatar <- libravatar user
|
||||
mcurrentRoute <- getCurrentRoute
|
||||
userProfiles <- handlerToWidget . runDB $ do
|
||||
profiles <- map entityVal <$> selectList [ProfileUserId ==. userId] []
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue