]> granicus.if.org Git - ejabberd/commitdiff
Add another variant of transformation of offline_msg in mod_offline_mnesia
authorPaweł Chmielowski <pchmielowski@process-one.net>
Fri, 16 Aug 2019 16:34:42 +0000 (18:34 +0200)
committerPaweł Chmielowski <pchmielowski@process-one.net>
Fri, 16 Aug 2019 16:34:42 +0000 (18:34 +0200)
src/mod_offline_mnesia.erl

index 7fec22a6cb755a13c5d829d0522ef00f3c904eb3..5d0bf2921aafe3fce32513b6291c0e2a250408db 100644 (file)
@@ -168,9 +168,14 @@ need_transform({offline_msg, {U, S}, _, _, _, _, _})
   when is_list(U) orelse is_list(S) ->
     ?INFO_MSG("Mnesia table 'offline_msg' will be converted to binary", []),
     true;
+need_transform({offline_msg, _, _, _, _, _, _, _}) ->
+    true;
 need_transform(_) ->
     false.
 
+transform({offline_msg, {U, S}, Timestamp, Expire, From, To, _, Packet}) ->
+    #offline_msg{us = {U, S}, timestamp = Timestamp, expire = Expire,
+                from = From ,to = To, packet = Packet};
 transform(#offline_msg{us = {U, S}, from = From, to = To,
                       packet = El} = R) ->
     R#offline_msg{us = {iolist_to_binary(U), iolist_to_binary(S)},