From: Paweł Chmielowski Date: Fri, 16 Aug 2019 16:34:42 +0000 (+0200) Subject: Add another variant of transformation of offline_msg in mod_offline_mnesia X-Git-Tag: 19.09~49 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=07ef1775cd0111ac6b5d710fefb9afd54f048db0;p=ejabberd Add another variant of transformation of offline_msg in mod_offline_mnesia --- diff --git a/src/mod_offline_mnesia.erl b/src/mod_offline_mnesia.erl index 7fec22a6c..5d0bf2921 100644 --- a/src/mod_offline_mnesia.erl +++ b/src/mod_offline_mnesia.erl @@ -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)},