From: Christophe Romain Date: Thu, 16 Oct 2008 22:12:05 +0000 (+0000) Subject: fix badarg issue on get_roster_info when allowed roster groups is not defined X-Git-Tag: v2.1.0~18^2~558 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a910c4baa1e12ed2407ea0b598379eeb5e4cdde4;p=ejabberd fix badarg issue on get_roster_info when allowed roster groups is not defined SVN Revision: 1656 --- diff --git a/ChangeLog b/ChangeLog index c435db204..49bb0bac0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-10-17 Christophe Romain + + * src/mod_pubsub/mod_pubsub.erl: fix badarg issue on get_roster_info + when allowed roster groups is not defined + 2008-10-14 Christophe Romain * src/mod_pubsub/mod_pubsub.erl: fix pubsub_publish_item hook diff --git a/src/mod_pubsub/mod_pubsub.erl b/src/mod_pubsub/mod_pubsub.erl index 7fb9334da..aa395743a 100644 --- a/src/mod_pubsub/mod_pubsub.erl +++ b/src/mod_pubsub/mod_pubsub.erl @@ -496,7 +496,7 @@ handle_cast({presence, JID, Pid}, State) -> whitelist -> false; % subscribers are added manually authorize -> false; % likewise roster -> - Grps = get_option(Options, roster_groups_allowed), + Grps = get_option(Options, roster_groups_allowed, []), element(2, get_roster_info(User, Server, LJID, Grps)) end, if Subscribed -> @@ -1349,7 +1349,7 @@ subscribe_node(Host, Node, From, JID) -> SubscribeConfig = get_option(Options, subscribe), AccessModel = get_option(Options, access_model), SendLast = get_option(Options, send_last_published_item), - AllowedGroups = get_option(Options, roster_groups_allowed), + AllowedGroups = get_option(Options, roster_groups_allowed, []), {PresenceSubscription, RosterGroup} = case Host of {OUser, OServer, _} -> @@ -1660,7 +1660,7 @@ get_items(Host, Node, From, SubId, SMaxItems, ItemIDs) -> RetreiveFeature = lists:member("retrieve-items", Features), PersistentFeature = lists:member("persistent-items", Features), AccessModel = get_option(Options, access_model), - AllowedGroups = get_option(Options, roster_groups_allowed), + AllowedGroups = get_option(Options, roster_groups_allowed, []), {PresenceSubscription, RosterGroup} = case Host of {OUser, OServer, _} -> @@ -2507,7 +2507,7 @@ get_configure_xfields(_Type, Options, Lang, _Owners) -> {"label", translate:translate(Lang, "Roster groups allowed to subscribe")}, {"var", "pubsub#roster_groups_allowed"}], [{xmlelement, "value", [], [{xmlcdata, Value}]} || - Value <- get_option(Options, roster_groups_allowed)]}, + Value <- get_option(Options, roster_groups_allowed, [])]}, ?ALIST_CONFIG_FIELD("Specify the publisher model", publish_model, [publishers, subscribers, open]), ?INTEGER_CONFIG_FIELD("Max payload size in bytes", max_payload_size),