From fd1b3499b684cb4be69bc0ce4474d74c1ef1ef17 Mon Sep 17 00:00:00 2001 From: lda Date: Wed, 19 Feb 2025 15:32:52 +0000 Subject: [PATCH] [ADD] Allow the main component to be used to issue commands --- src/AS/Send.c | 7 ------- src/XMPPThread/Stanzas/IQ.c | 5 +++-- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/src/AS/Send.c b/src/AS/Send.c index 9b81a71..6811548 100644 --- a/src/AS/Send.c +++ b/src/AS/Send.c @@ -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); diff --git a/src/XMPPThread/Stanzas/IQ.c b/src/XMPPThread/Stanzas/IQ.c index 5dc9bc3..1b5087d 100644 --- a/src/XMPPThread/Stanzas/IQ.c +++ b/src/XMPPThread/Stanzas/IQ.c @@ -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;