diff options
Diffstat (limited to 'src/mod_shared_roster_mnesia.erl')
-rw-r--r-- | src/mod_shared_roster_mnesia.erl | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/mod_shared_roster_mnesia.erl b/src/mod_shared_roster_mnesia.erl index 2af945e6..c83cbfe9 100644 --- a/src/mod_shared_roster_mnesia.erl +++ b/src/mod_shared_roster_mnesia.erl @@ -156,9 +156,19 @@ need_transform({sr_user, {U, S}, {G, H}}) when is_list(U) orelse is_list(S) orelse is_list(G) orelse is_list(H) -> ?INFO_MSG("Mnesia table 'sr_user' will be converted to binary", []), true; +need_transform({sr_group, {G, H}, [{name, _} | _]}) -> + ?INFO_MSG("Mnesia table 'sr_group' will be converted from option Name to Label", []), + true; need_transform(_) -> false. +transform(#sr_group{group_host = {G, H}, opts = Opts} = R) + when is_binary(G) -> + Opts2 = case proplists:get_value(name, Opts, false) of + false -> Opts; + Name -> [{label, Name} | proplists:delete(name, Opts)] + end, + R#sr_group{opts = Opts2}; transform(#sr_group{group_host = {G, H}, opts = Opts} = R) -> R#sr_group{group_host = {iolist_to_binary(G), iolist_to_binary(H)}, opts = mod_shared_roster:opts_to_binary(Opts)}; |