Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
pleroma
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
normandy
pleroma
Commits
7057891d
Commit
7057891d
authored
6 years ago
by
rinpatch
Browse files
Options
Downloads
Patches
Plain Diff
Make rich media support toggleable
parent
bd89cdbe
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
config/config.exs
+2
-0
2 additions, 0 deletions
config/config.exs
docs/config.md
+3
-0
3 additions, 0 deletions
docs/config.md
lib/pleroma/web/rich_media/helpers.ex
+2
-1
2 additions, 1 deletion
lib/pleroma/web/rich_media/helpers.ex
with
7 additions
and
1 deletion
config/config.exs
+
2
−
0
View file @
7057891d
...
...
@@ -235,6 +235,8 @@ config :pleroma, :mrf_simple,
reject:
[],
accept:
[]
config
:pleroma
,
:rich_media
,
enabled:
true
config
:pleroma
,
:media_proxy
,
enabled:
false
,
proxy_opts:
[
...
...
This diff is collapsed.
Click to expand it.
docs/config.md
+
3
−
0
View file @
7057891d
...
...
@@ -235,6 +235,9 @@ curl "http://localhost:4000/api/pleroma/admin/invite_token?admin_token=somerando
*
Pleroma.Web.Metadata.Providers.TwitterCard
*
`unfurl_nsfw`
: If set to
`true`
nsfw attachments will be shown in previews
## :rich_media
*
`enabled`
: if enabled the instance will parse metadata from attached links to generate link previews
## :hackney_pools
Advanced. Tweaks Hackney (http client) connections pools.
...
...
This diff is collapsed.
Click to expand it.
lib/pleroma/web/rich_media/helpers.ex
+
2
−
1
View file @
7057891d
...
...
@@ -7,7 +7,8 @@ defmodule Pleroma.Web.RichMedia.Helpers do
alias
Pleroma
.
Web
.
RichMedia
.
Parser
def
fetch_data_for_activity
(%
Activity
{}
=
activity
)
do
with
%
Object
{}
=
object
<-
Object
.
normalize
(
activity
.
data
[
"object"
]),
with
true
<-
Pleroma
.
Config
.
get
([
:rich_media
,
:enabled
],
true
),
%
Object
{}
=
object
<-
Object
.
normalize
(
activity
.
data
[
"object"
]),
{
:ok
,
page_url
}
<-
HTML
.
extract_first_external_url
(
object
,
object
.
data
[
"content"
]),
{
:ok
,
rich_media
}
<-
Parser
.
parse
(
page_url
)
do
%{
page_url:
page_url
,
rich_media:
rich_media
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment