summaryrefslogtreecommitdiff
path: root/louloulibs/xmpp
diff options
context:
space:
mode:
Diffstat (limited to 'louloulibs/xmpp')
-rw-r--r--louloulibs/xmpp/xmpp_component.cpp4
-rw-r--r--louloulibs/xmpp/xmpp_component.hpp3
2 files changed, 5 insertions, 2 deletions
diff --git a/louloulibs/xmpp/xmpp_component.cpp b/louloulibs/xmpp/xmpp_component.cpp
index 1048f86..8e89208 100644
--- a/louloulibs/xmpp/xmpp_component.cpp
+++ b/louloulibs/xmpp/xmpp_component.cpp
@@ -651,7 +651,7 @@ void XmppComponent::send_version(const std::string& id, const std::string& jid_t
this->send_stanza(iq);
}
-void XmppComponent::send_adhoc_commands_list(const std::string& id, const std::string& requester_jid)
+void XmppComponent::send_adhoc_commands_list(const std::string& id, const std::string& requester_jid, const bool with_admin_only)
{
Stanza iq("iq");
iq["type"] = "result";
@@ -663,6 +663,8 @@ void XmppComponent::send_adhoc_commands_list(const std::string& id, const std::s
query["node"] = ADHOC_NS;
for (const auto& kv: this->adhoc_commands_handler.get_commands())
{
+ if (kv.second.is_admin_only() && !with_admin_only)
+ continue;
XmlNode item("item");
item["jid"] = this->served_hostname;
item["node"] = kv.first;
diff --git a/louloulibs/xmpp/xmpp_component.hpp b/louloulibs/xmpp/xmpp_component.hpp
index 1bea54e..e45bb36 100644
--- a/louloulibs/xmpp/xmpp_component.hpp
+++ b/louloulibs/xmpp/xmpp_component.hpp
@@ -184,7 +184,8 @@ public:
* Send the list of all available ad-hoc commands to that JID. The list is
* different depending on what JID made the request.
*/
- void send_adhoc_commands_list(const std::string& id, const std::string& requester_jid);
+ void send_adhoc_commands_list(const std::string& id, const std::string& requester_jid,
+ const bool with_admin_only);
/**
* Send an iq version request
*/