25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-22 16:20:52 +01:00

* src/mod_pubsub/mod_pubsub.erl: Fix incorrect implementation of

Pubsub payload requirements (thanks to Andy Skelton)(EJAB-823)

SVN Revision: 1921
This commit is contained in:
Badlop 2009-02-25 21:17:14 +00:00
parent 2678342c4a
commit 34f6de0c84
2 changed files with 12 additions and 5 deletions

View File

@ -1,3 +1,8 @@
2009-02-25 Badlop <badlop@process-one.net>
* src/mod_pubsub/mod_pubsub.erl: Fix incorrect implementation of
Pubsub payload requirements (thanks to Andy Skelton)(EJAB-823)
2009-02-24 Pablo Polvorin <pablo.polvorin@process-one.net>
* src/ejabberd_service.erl: Exmpp related fixed to the external
@ -9,6 +14,7 @@
to be in list() format.
2009-02-23 Pablo Polvorin <pablo.polvorin@process-one.net>
* src/ejabberd_c2s.erl, src/mod_echo.erl, src/mod_roster.erl,
src/mod_roster_odbc.erl: Use exmpp_jid:to_binary/1 when possible.
@ -51,7 +57,6 @@
* src/web/ejabberd_web_admin.erl: Fix add / remove users.
* src/mod_configure.erl: Fix bug in form generation.
2009-02-19 Christophe Romain <christophe.romain@process-one.net>

View File

@ -1491,6 +1491,8 @@ publish_item(Host, ServerHost, Node, Publisher, ItemId, Payload) ->
PublishFeature = lists:member("publish", Features),
PublishModel = get_option(Options, publish_model),
MaxItems = max_items(Options),
DeliverPayloads = get_option(Options, deliver_payloads),
PersistItems = get_option(Options, persist_items),
PayloadCount = payload_xmlelements(Payload),
PayloadSize = size(term_to_binary(Payload)),
PayloadMaxSize = get_option(Options, max_payload_size),
@ -1509,11 +1511,11 @@ publish_item(Host, ServerHost, Node, Publisher, ItemId, Payload) ->
Payload == "" ->
%% Publisher attempts to publish to payload node with no payload
{error, extended_error('bad-request', "payload-required")};
(MaxItems == 0) and (PayloadSize > 0) ->
% Publisher attempts to publish to transient notification node with item
(DeliverPayloads == 0) and (PersistItems == 0) and (PayloadSize > 0) ->
%% Publisher attempts to publish to transient notification node with item
{error, extended_error('bad-request', "item-forbidden")};
(MaxItems > 0) and (PayloadSize == 0) ->
% Publisher attempts to publish to persistent node with no item
((DeliverPayloads == 1) or (PersistItems == 1)) and (PayloadSize == 0) ->
%% Publisher attempts to publish to persistent node with no item
{error, extended_error('bad-request', "item-required")};
true ->
node_call(Type, publish_item, [Host, Node, Publisher, PublishModel, MaxItems, ItemId, Payload])