diff options
author | Paweł Chmielowski <pchmielowski@process-one.net> | 2021-04-16 11:55:48 +0200 |
---|---|---|
committer | Paweł Chmielowski <pchmielowski@process-one.net> | 2021-04-16 11:55:48 +0200 |
commit | e462f0a584bcf58547247d532e10fc1994c2ab1e (patch) | |
tree | 5564d666fb430f47dff7cdc32a003a165da528e2 /src | |
parent | Fix syntax not recognized by older erlang (diff) |
Fix dialyzer warnings
Diffstat (limited to 'src')
-rw-r--r-- | src/mod_shared_roster.erl | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/mod_shared_roster.erl b/src/mod_shared_roster.erl index 32f0b7e79..3f200986e 100644 --- a/src/mod_shared_roster.erl +++ b/src/mod_shared_roster.erl @@ -578,7 +578,7 @@ update_wildcard_cache(Host, Group, NewOpts) -> _ -> Online -- [Group] end, ets_cache:update(?SPECIAL_GROUPS_CACHE, {Host, online}, - NewOnline, fun() -> ok end, cache_nodes(Mod, Host)); + {ok, NewOnline}, fun() -> ok end, cache_nodes(Mod, Host)); true -> ok end, if @@ -588,13 +588,14 @@ update_wildcard_cache(Host, Group, NewOpts) -> _ -> Both -- [Group] end, ets_cache:update(?SPECIAL_GROUPS_CACHE, {Host, both}, - NewBoth, fun() -> ok end, cache_nodes(Mod, Host)); + {ok, NewBoth}, fun() -> ok end, cache_nodes(Mod, Host)); true -> ok end, ok. -spec get_groups_with_wildcards(binary(), online | both) -> list(binary()). get_groups_with_wildcards(Host, Type) -> + Res = ets_cache:lookup( ?SPECIAL_GROUPS_CACHE, {Host, Type}, fun() -> @@ -607,8 +608,12 @@ get_groups_with_wildcards(Host, Type) -> end end, groups_with_opts(Host)), - {cache, Res} - end). + {cache, {ok, Res}} + end), + case Res of + {ok, List} -> List; + _ -> [] + end. %% Given two lists of groupnames and their options, %% return the list of displayed groups to the second list |