[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

@ -69,13 +69,6 @@ ASSend(const ParseeConfig *conf, char *id, char *user, char *type, HashMap *c, u
reply = JsonDecode(HttpClientStream(ctx));
ret = StrDuplicate(JsonValueAsString(HashMapGet(reply, "event_id")));
if (!ret)
{
Log(LOG_ERR, "Got %s from HTTP", HttpStatusToString(status));
JsonEncode(reply, StreamStdout(), JSON_PRETTY);
StreamPrintf(StreamStdout(), "\n");
StreamFlush(StreamStdout());
}
JsonFree(reply);
HttpClientContextFree(ctx);

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;