25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-12-22 17:28:25 +01:00

fix minor timestamp shift between item creation and modification

SVN Revision: 2585
This commit is contained in:
Christophe Romain 2009-09-04 23:32:13 +00:00
parent 9d8de17b4d
commit 860957d20c

View File

@ -481,14 +481,15 @@ publish_item(NodeId, Publisher, PublishModel, MaxItems, ItemId, Payload) ->
true -> true ->
%% TODO: check creation, presence, roster %% TODO: check creation, presence, roster
if MaxItems > 0 -> if MaxItems > 0 ->
PubId = {now(), SubKey}, Now = now(),
PubId = {Now, SubKey},
Item = case get_item(NodeId, ItemId) of Item = case get_item(NodeId, ItemId) of
{result, OldItem} -> {result, OldItem} ->
OldItem#pubsub_item{modification = PubId, OldItem#pubsub_item{modification = PubId,
payload = Payload}; payload = Payload};
_ -> _ ->
#pubsub_item{itemid = {ItemId, NodeId}, #pubsub_item{itemid = {ItemId, NodeId},
creation = {now(), GenKey}, creation = {Now, GenKey},
modification = PubId, modification = PubId,
payload = Payload} payload = Payload}
end, end,