From: Holger Weiss Date: Thu, 13 Oct 2016 20:34:29 +0000 (+0200) Subject: Always include with ad-hoc responses X-Git-Tag: 16.12~25^2~16 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d97e777c9bc721a6b342b1f941150de0f94ff15d;p=ejabberd 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. --- 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 = [];