importKey :: MonadIO m => ByteString -> PSM m [ByteString]
importKey key = do
    ctx <- liftIO $ Gpg.ctxNew Nothing
    importResults <- liftIO $ Gpg.importKeys ctx key
    liftM catMaybes $ forM importResults $ \res ->
        case Gpg.isResult res of
            Nothing -> do
                let fPrint = Gpg.isFprint res
--                addPeerKey st peer (PubKey "gpg" fPrint)
                return $ Just fPrint
            Just err -> do
                liftIO . errorM "Pontarius.Xmpp" $ "error while importing key" ++ show err
                return Nothing
importKey :: MonadIO m => ByteString -> PSM m [ByteString]
importKey key = do
    ctx <- liftIO $ Gpg.ctxNew Nothing
    importResults <- liftIO $ Gpg.importKeys ctx key
    liftM catMaybes $ forM importResults $ \res ->
        case Gpg.isResult res of
            Nothing -> do
                let fPrint = Gpg.isFprint res
--                addPeerKey st peer (PubKey "gpg" fPrint)
                return $ Just fPrint
            Just err -> do
                liftIO . errorM "Pontarius.Xmpp" $ "error while importing key" ++ show err
                return Nothing
importKey key = do
    ctx <- liftIO $ Gpg.ctxNew Nothing
    importResults <- liftIO $ Gpg.importKeys ctx key
    liftM catMaybes $ forM importResults $ \res ->
        case Gpg.isResult res of
            Nothing -> do
                let fPrint = Gpg.isFprint res
--                addPeerKey st peer (PubKey "gpg" fPrint)
                return $ Just fPrint
            Just err -> do
                liftIO . errorM "Pontarius.Xmpp" $ "error while importing key" ++ show err
                return Nothing