diff options
author | Holger Weiss <holger@zedat.fu-berlin.de> | 2016-10-13 22:34:29 +0200 |
---|---|---|
committer | Holger Weiss <holger@zedat.fu-berlin.de> | 2016-10-13 22:34:29 +0200 |
commit | d97e777c9bc721a6b342b1f941150de0f94ff15d (patch) | |
tree | fbbf1aa5662332dfda09cd5723d7181871896b5d /src | |
parent | Don't let MAM messages go into offline storage (diff) |
Always include <actions/> with ad-hoc responses
XEP-0050 says: "The result for each stage (other than the last) of a
command's execution SHOULD include an <actions/> element." Some clients
insist on this.
Diffstat (limited to 'src')
-rw-r--r-- | src/adhoc.erl | 12 |
1 files 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 = []; |