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

fix minor timestamp shift between item creation and modification

SVN Revision: 2586
This commit is contained in:
Christophe Romain 2009-09-04 23:34:05 +00:00
parent 283aa52b31
commit 75dbcd5c68

View File

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