From d97e777c9bc721a6b342b1f941150de0f94ff15d Mon Sep 17 00:00:00 2001 From: Holger Weiss Date: Thu, 13 Oct 2016 22:34:29 +0200 Subject: [PATCH] Always include with ad-hoc responses XEP-0050 says: "The result for each stage (other than the last) of a command's execution SHOULD include an element." Some clients insist on this. --- src/adhoc.erl | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/adhoc.erl b/src/adhoc.erl index 6970584f9..23ffd8dd8 100644 --- a/src/adhoc.erl +++ b/src/adhoc.erl @@ -112,9 +112,17 @@ produce_response( ProvidedSessionID /= <<"">> -> ProvidedSessionID; true -> jlib:now_to_utc_string(p1_time_compat:timestamp()) end, - case Actions of - [] -> + case {Actions, Status} of + {[], completed} -> ActionsEls = []; + {[], _} -> + ActionsEls = [ + #xmlel{ + name = <<"actions">>, + attrs = [{<<"execute">>, <<"complete">>}], + children = [#xmlel{name = <<"complete">>}] + } + ]; _ -> case DefaultAction of <<"">> -> ActionsElAttrs = [];