node_flat: Avoid catch-all clauses for RSM

Apply the change made in the previous commit to Mnesia storage as well.
This commit is contained in:
Holger Weiss 2021-08-23 22:04:03 +02:00
parent c952cc420b
commit ebf03a3745
1 changed files with 4 additions and 7 deletions

View File

@ -957,15 +957,12 @@ rsm_page(Count, Index, Offset, Items) ->
last = Last}. last = Last}.
encode_stamp(Stamp) -> encode_stamp(Stamp) ->
case catch xmpp_util:decode_timestamp(Stamp) of try xmpp_util:decode_timestamp(Stamp)
{MS,S,US} -> {MS,S,US}; catch _:{bad_timestamp, _} ->
_ -> Stamp Stamp % We should return a proper error to the client instead.
end. end.
decode_stamp(Stamp) -> decode_stamp(Stamp) ->
case catch xmpp_util:encode_timestamp(Stamp) of xmpp_util:encode_timestamp(Stamp).
TimeStamp when is_binary(TimeStamp) -> TimeStamp;
_ -> Stamp
end.
transform({pubsub_state, {Id, Nidx}, Is, A, Ss}) -> transform({pubsub_state, {Id, Nidx}, Is, A, Ss}) ->
{pubsub_state, {Id, Nidx}, Nidx, Is, A, Ss}; {pubsub_state, {Id, Nidx}, Nidx, Is, A, Ss};