]> granicus.if.org Git - ejabberd/commitdiff
fix badarg issue on get_roster_info when allowed roster groups is not defined
authorChristophe Romain <christophe.romain@process-one.net>
Thu, 16 Oct 2008 22:14:04 +0000 (22:14 +0000)
committerChristophe Romain <christophe.romain@process-one.net>
Thu, 16 Oct 2008 22:14:04 +0000 (22:14 +0000)
SVN Revision: 1657

ChangeLog
src/mod_pubsub/mod_pubsub.erl

index 4c9be11e072cc19f2d8bccd37193a24e7aac2aad..1d2f7bf9cc5ef1476fee34ff4b01137fca9f66f2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2008-10-17  Christophe Romain <christophe.romain@process-one.net>
+
+       * src/mod_pubsub/mod_pubsub.erl: fix badarg issue on get_roster_info
+       when allowed roster groups is not defined
+
 2008-10-13  Jerome Sautret  <jerome.sautret@process-one.net>
 
        * src/odbc/ejabberd_odbc.erl: log MySQL driver messages.
index dffd8af750e76e0a9f62bd749d8f8a5568e7f458..cd168f888cf0d52476c28960dd095f8bc1e48e02 100644 (file)
@@ -491,7 +491,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 ->
@@ -1345,7 +1345,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, _} ->
@@ -1661,7 +1661,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, _} ->
@@ -2501,7 +2501,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),