Commit d68b3f02 authored by Jonne Haß's avatar Jonne Haß Committed by Dennis Schubert

Expose whether chat is enabled as NodeInfo metadata

related to #6211
parent b7064677
......@@ -9,6 +9,8 @@
## Features
* Implement NodeInfo [#6239](https://github.com/diaspora/diaspora/pull/6239)
# 0.5.2.0
## Refactor
......
......@@ -21,6 +21,7 @@ class NodeInfoPresenter
doc.services = available_services
doc.open_registrations = open_registrations?
doc.metadata["nodeName"] = name
doc.metadata["xmppChat"] = chat_enabled?
end
def add_static_data(doc)
......@@ -66,6 +67,10 @@ class NodeInfoPresenter
AppConfig.settings.enable_registrations?
end
def chat_enabled?
AppConfig.chat.enabled?
end
def available_services
Configuration::KNOWN_SERVICES.select {|service|
AppConfig.show_service?(service, nil)
......
......@@ -35,7 +35,8 @@ describe NodeInfoPresenter do
"users" => {}
},
"metadata" => {
"nodeName" => AppConfig.settings.pod_name
"nodeName" => AppConfig.settings.pod_name,
"xmppChat" => AppConfig.chat.enabled?
}
)
end
......@@ -116,5 +117,15 @@ describe NodeInfoPresenter do
expect(presenter.open_registrations?).to be false
end
end
context "when chat is enabled" do
before do
AppConfig.chat.enabled = true
end
it "should mark the xmppChat metadata as true" do
expect(hash).to include "metadata" => include("xmppChat" => true)
end
end
end
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment