Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
librenet.gr
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Insights
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Security & Compliance
Security & Compliance
Dependency List
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
LibreOps
librenet.gr
Commits
ac39e920
Unverified
Commit
ac39e920
authored
Sep 15, 2017
by
Benjamin Neff
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add camo to NodeInfo
closes #7617
parent
e4b0b569
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
2 deletions
+38
-2
Changelog.md
Changelog.md
+1
-0
app/presenters/node_info_presenter.rb
app/presenters/node_info_presenter.rb
+9
-0
spec/presenters/node_info_presenter_spec.rb
spec/presenters/node_info_presenter_spec.rb
+28
-2
No files found.
Changelog.md
View file @
ac39e920
...
...
@@ -28,6 +28,7 @@
*
Ask for confirmation when leaving a submittable comment field
[
#7530
](
https://github.com/diaspora/diaspora/pull/7530
)
*
Show users vote in polls
[
#7550
](
https://github.com/diaspora/diaspora/pull/7550
)
*
Add explanation of ignore function to in-app help section
[
#7585
](
https://github.com/diaspora/diaspora/pull/7585
)
*
Add camo information to NodeInfo
[
#7617
](
https://github.com/diaspora/diaspora/pull/7617
)
# 0.7.0.1
...
...
app/presenters/node_info_presenter.rb
View file @
ac39e920
...
...
@@ -24,6 +24,7 @@ class NodeInfoPresenter
doc
.
open_registrations
=
open_registrations?
doc
.
metadata
[
"nodeName"
]
=
name
doc
.
metadata
[
"xmppChat"
]
=
chat_enabled?
doc
.
metadata
[
"camo"
]
=
camo_config
doc
.
metadata
[
"adminAccount"
]
=
admin_account
end
...
...
@@ -73,6 +74,14 @@ class NodeInfoPresenter
AppConfig
.
chat
.
enabled?
end
def
camo_config
{
markdown:
AppConfig
.
privacy
.
camo
.
proxy_markdown_images?
,
opengraph:
AppConfig
.
privacy
.
camo
.
proxy_opengraph_thumbnails?
,
remotePods:
AppConfig
.
privacy
.
camo
.
proxy_remote_pod_images?
}
end
def
admin_account
AppConfig
.
admins
.
account
if
AppConfig
.
admins
.
account?
end
...
...
spec/presenters/node_info_presenter_spec.rb
View file @
ac39e920
...
...
@@ -39,7 +39,12 @@ describe NodeInfoPresenter do
},
"metadata"
=>
{
"nodeName"
=>
AppConfig
.
settings
.
pod_name
,
"xmppChat"
=>
AppConfig
.
chat
.
enabled?
"xmppChat"
=>
AppConfig
.
chat
.
enabled?
,
"camo"
=>
{
"markdown"
=>
AppConfig
.
privacy
.
camo
.
proxy_markdown_images?
,
"opengraph"
=>
AppConfig
.
privacy
.
camo
.
proxy_opengraph_thumbnails?
,
"remotePods"
=>
AppConfig
.
privacy
.
camo
.
proxy_remote_pod_images?
}
}
)
end
...
...
@@ -131,6 +136,22 @@ describe NodeInfoPresenter do
end
end
context
"when camo is enabled"
do
before
do
AppConfig
.
privacy
.
camo
.
proxy_markdown_images
=
true
AppConfig
.
privacy
.
camo
.
proxy_opengraph_thumbnails
=
true
AppConfig
.
privacy
.
camo
.
proxy_remote_pod_images
=
true
end
it
"should list enabled camo options in the metadata as true"
do
expect
(
hash
).
to
include
"metadata"
=>
include
(
"camo"
=>
{
"markdown"
=>
true
,
"opengraph"
=>
true
,
"remotePods"
=>
true
})
end
end
context
"when admin account is set"
do
before
do
AppConfig
.
admins
.
account
=
"podmin"
...
...
@@ -160,7 +181,12 @@ describe NodeInfoPresenter do
},
"metadata"
=>
{
"nodeName"
=>
AppConfig
.
settings
.
pod_name
,
"xmppChat"
=>
AppConfig
.
chat
.
enabled?
"xmppChat"
=>
AppConfig
.
chat
.
enabled?
,
"camo"
=>
{
"markdown"
=>
AppConfig
.
privacy
.
camo
.
proxy_markdown_images?
,
"opengraph"
=>
AppConfig
.
privacy
.
camo
.
proxy_opengraph_thumbnails?
,
"remotePods"
=>
AppConfig
.
privacy
.
camo
.
proxy_remote_pod_images?
}
}
)
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment