Payload, PubOpts, Access)
end;
[] ->
- {error, extended_error(xmpp:err_bad_request(), err_item_required())};
+ publish_item(Host, ServerHost, Node, From, <<>>, [], [], Access);
_ ->
{error, extended_error(xmpp:err_bad_request(), err_invalid_payload())}
end;
PayloadSize > PayloadMaxSize ->
{error, extended_error(xmpp:err_not_acceptable(),
err_payload_too_big())};
- (PayloadCount == 0) and (Payload == []) ->
+ (DeliverPayloads or PersistItems) and (PayloadCount == 0) ->
{error, extended_error(xmpp:err_bad_request(),
- err_payload_required())};
- (PayloadCount > 1) or (PayloadCount == 0) ->
+ err_item_required())};
+ (DeliverPayloads or PersistItems) and (PayloadCount > 1) ->
{error, extended_error(xmpp:err_bad_request(),
err_invalid_payload())};
- (DeliverPayloads == false) and (PersistItems == false) and
- (PayloadSize > 0) ->
+ (not DeliverPayloads) and (PayloadCount > 0) ->
{error, extended_error(xmpp:err_bad_request(),
err_item_forbidden())};
- ((DeliverPayloads == true) or (PersistItems == true)) and (PayloadSize == 0) ->
- {error, extended_error(xmpp:err_bad_request(),
- err_item_required())};
true ->
node_call(Host, Type, publish_item,
[Nidx, Publisher, PublishModel, MaxItems, ItemId, Payload, PubOpts])