[ADD] Allow the main component to be used to issue commands

This commit is contained in:
lda 2025-02-19 15:32:52 +00:00
commit fd1b3499b6
2 changed files with 3 additions and 9 deletions

View file

@ -374,7 +374,7 @@ IQResult(ParseeData *args, XMLElement *stanza, XMPPThread *thr)
bool
IQIsCommandList(ParseeData *args, XMLElement *stanza)
{
char *parsee = NULL;
char *parsee = NULL, *to;
XMLElement *query = XMLookForTKV(
stanza, "query", "xmlns",
"http://jabber.org/protocol/disco#items"
@ -389,7 +389,8 @@ IQIsCommandList(ParseeData *args, XMLElement *stanza)
}
parsee = ParseeJID(args);
ret = StrEquals(HashMapGet(stanza->attrs, "to"), parsee);
to = HashMapGet(stanza->attrs, "to");
ret = StrEquals(to, parsee) || StrEquals(to, args->config->component_host);
Free(parsee);
return ret;