25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-12-02 16:37:52 +01:00

does not write item when max_items set to 0 (solves EJAB-768)

SVN Revision: 1660
This commit is contained in:
Christophe Romain 2008-10-17 00:42:20 +00:00
parent a2b8263a20
commit 26cf780476
2 changed files with 7 additions and 2 deletions

View File

@ -6,6 +6,9 @@
* src/mod_pubsub/mod_pubsub.erl: fix remove_user not unsubscribing
user (EJAB-684)
* src/mod_pubsub/node_default.erl: does not write item when max_items
set to 0 (solves EJAB-768)
2008-10-13 Jerome Sautret <jerome.sautret@process-one.net>
* src/odbc/ejabberd_odbc.erl: log MySQL driver messages.

View File

@ -452,10 +452,12 @@ publish_item(Host, Node, Publisher, PublishModel, MaxItems, ItemId, Payload) ->
OldItem#pubsub_item{modification = PubId,
payload = Payload}
end,
Items = [ItemId | State#pubsub_state.items],
Items = [ItemId | State#pubsub_state.items--[ItemId]],
{result, {NI, OI}} = remove_extra_items(
Host, Node, MaxItems, Items),
set_item(Item),
if MaxItems > 0 -> set_item(Item);
true -> ok
end,
set_state(State#pubsub_state{items = NI}),
{result, {default, broadcast, OI}}
end.