<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1228,7 +1228,7 @@ iq_sm(From, To, #iq{type = Type, payload = SubEl, ns = XMLNS, lang = Lang} = IQ_
 	  end,
     case Res of
 	{result, []}      -&gt; exmpp_iq:result(IQ_Rec);
-	{result, [IQRes]} -&gt; exmpp_iq:result(IQ_Rec, IQRes);
+	{result, IQRes} -&gt; exmpp_iq:result(IQ_Rec, IQRes);
 	{error, Error}    -&gt; exmpp_iq:error(IQ_Rec, Error)
     end.
 
@@ -2848,12 +2848,11 @@ set_subscriptions(Host, Node, From, EntitiesEls) -&gt;
 %% @spec (OwnerUser, OwnerServer, {SubscriberUser, SubscriberServer, SubscriberResource}, AllowedGroups)
 %%    -&gt; {PresenceSubscription, RosterGroup}
 get_roster_info(OwnerUser, OwnerServer, {SubscriberUser, SubscriberServer, _}, AllowedGroups) -&gt;
-     OwnerServerB = list_to_binary(OwnerServer),
     {Subscription, Groups} =
 	ejabberd_hooks:run_fold(
-	  roster_get_jid_info, OwnerServerB,
+	  roster_get_jid_info, OwnerServer,
 	  {none, []},
-	  [OwnerUser, OwnerServer, {SubscriberUser, SubscriberServer, undefined}]),
+	  [OwnerUser, OwnerServer, exmpp_jid:make({SubscriberUser, SubscriberServer, undefined})]),
     PresenceSubscription = (Subscription == both) orelse (Subscription == from)
 			    orelse ({OwnerUser, OwnerServer} == {SubscriberUser, SubscriberServer}),
     RosterGroup = lists:any(fun(Group) -&gt;</diff>
      <filename>src/mod_pubsub/mod_pubsub.erl</filename>
    </modified>
    <modified>
      <diff>@@ -1036,7 +1036,7 @@ iq_sm(From, To, #iq{type = Type, payload = SubEl, ns = XMLNS, lang = Lang} = IQ_
 	  end,
     case Res of
 	{result, []}      -&gt; exmpp_iq:result(IQ_Rec);
-	{result, [IQRes]} -&gt; exmpp_iq:result(IQ_Rec, IQRes);
+	{result, IQRes} -&gt; exmpp_iq:result(IQ_Rec, IQRes);
 	{error, Error}    -&gt; exmpp_iq:error(IQ_Rec, Error)
     end.
 
@@ -2658,12 +2658,11 @@ set_subscriptions(Host, Node, From, EntitiesEls) -&gt;
 %% @spec (OwnerUser, OwnerServer, {SubscriberUser, SubscriberServer, SubscriberResource}, AllowedGroups)
 %%    -&gt; {PresenceSubscription, RosterGroup}
 get_roster_info(OwnerUser, OwnerServer, {SubscriberUser, SubscriberServer, _}, AllowedGroups) -&gt;
-     OwnerServerB = list_to_binary(OwnerServer),
     {Subscription, Groups} =
 	ejabberd_hooks:run_fold(
-	  roster_get_jid_info, OwnerServerB,
+	  roster_get_jid_info, OwnerServer,
 	  {none, []},
-	  [OwnerUser, OwnerServer, {SubscriberUser, SubscriberServer, undefined}]),
+	  [OwnerUser, OwnerServer, exmpp_jid:make({SubscriberUser, SubscriberServer, undefined})]),
     PresenceSubscription = (Subscription == both) orelse (Subscription == from)
 			    orelse ({OwnerUser, OwnerServer} == {SubscriberUser, SubscriberServer}),
     RosterGroup = lists:any(fun(Group) -&gt;</diff>
      <filename>src/mod_pubsub/mod_pubsub_odbc.erl</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,5 @@
---- mod_pubsub.erl	2009-11-05 18:37:16.000000000 +0100
-+++ mod_pubsub_odbc.erl	2009-11-05 18:37:21.000000000 +0100
+--- mod_pubsub.erl	2009-11-06 15:30:53.000000000 +0100
++++ mod_pubsub_odbc.erl	2009-11-06 15:31:06.000000000 +0100
 @@ -42,7 +42,7 @@
  %%% 6.2.3.1, 6.2.3.5, and 6.3. For information on subscription leases see
  %%% XEP-0060 section 12.18.
@@ -679,7 +679,7 @@
  				true -&gt;
  				    Result = lists:foldl(fun({JID, Subscription, SubId}, Acc) -&gt;
  
-@@ -3111,7 +2921,7 @@
+@@ -3110,7 +2920,7 @@
  			{Depth, [{N, get_node_subs(N)} || N &lt;- Nodes]}
  	    end, tree_call(Host, get_parentnodes_tree, [Host, Node, service_jid(Host)]))}
  	end,
@@ -688,7 +688,7 @@
  	{result, CollSubs} -&gt; CollSubs;
  	_ -&gt; []
      end.
-@@ -3125,9 +2935,9 @@
+@@ -3124,9 +2934,9 @@
  
  get_options_for_subs(NodeID, Subs) -&gt;
      lists:foldl(fun({JID, subscribed, SubID}, Acc) -&gt;
@@ -700,7 +700,7 @@
  			    _ -&gt; Acc
  			end;
  		    (_, Acc) -&gt;
-@@ -3135,7 +2945,7 @@
+@@ -3134,7 +2944,7 @@
  		end, [], Subs).
  
  % TODO: merge broadcast code that way
@@ -709,7 +709,7 @@
  %broadcast(Host, Node, NodeId, Type, NodeOptions, Feature, Force, ElName, SubEls) -&gt;
  %    case (get_option(NodeOptions, Feature) or Force) of
  %	true -&gt;
-@@ -3327,6 +3137,30 @@
+@@ -3326,6 +3136,30 @@
  	    Result
      end.
  
@@ -740,7 +740,7 @@
  %% @spec (Host, Options) -&gt; MaxItems
  %%	 Host = host()
  %%	 Options = [Option]
-@@ -3716,7 +3550,13 @@
+@@ -3715,7 +3549,13 @@
  tree_action(Host, Function, Args) -&gt;
      ?DEBUG(&quot;tree_action ~p ~p ~p&quot;,[Host,Function,Args]),
      Fun = fun() -&gt; tree_call(Host, Function, Args) end,
@@ -755,7 +755,7 @@
  
  %% @doc &lt;p&gt;node plugin call.&lt;/p&gt;
  node_call(Type, Function, Args) -&gt;
-@@ -3736,13 +3576,13 @@
+@@ -3735,13 +3575,13 @@
  
  node_action(Host, Type, Function, Args) -&gt;
      ?DEBUG(&quot;node_action ~p ~p ~p ~p&quot;,[Host,Type,Function,Args]),
@@ -771,7 +771,7 @@
  			case tree_call(Host, get_node, [Host, Node]) of
  			    N when is_record(N, pubsub_node) -&gt;
  				case Action(N) of
-@@ -3755,8 +3595,15 @@
+@@ -3754,8 +3594,15 @@
  			end
  		end, Trans).
  
@@ -789,7 +789,7 @@
  	{result, Result} -&gt; {result, Result};
  	{error, Error} -&gt; {error, Error};
  	{atomic, {result, Result}} -&gt; {result, Result};
-@@ -3764,6 +3611,15 @@
+@@ -3763,6 +3610,15 @@
  	{aborted, Reason} -&gt;
  	    ?ERROR_MSG(&quot;transaction return internal error: ~p~n&quot;, [{aborted, Reason}]),
  	    {error, 'internal-server-error'};
@@ -805,7 +805,7 @@
  	{'EXIT', Reason} -&gt;
  	    ?ERROR_MSG(&quot;transaction return internal error: ~p~n&quot;, [{'EXIT', Reason}]),
  	    {error, 'internal-server-error'};
-@@ -3772,6 +3628,16 @@
+@@ -3771,6 +3627,16 @@
  	    {error, 'internal-server-error'}
      end.
  </diff>
      <filename>src/mod_pubsub/pubsub_odbc.patch</filename>
    </modified>
    <modified>
      <diff>@@ -138,20 +138,23 @@ get_options_xform(Lang, Options) -&gt;
 					   children = [?XMLCDATA(?NS_PUBSUB_SUBSCRIBE_OPTIONS_s)]}]}] ++ XFields}}.
 
 parse_options_xform(XFields) -&gt;
-    case exmpp_xml:get_child_elements(XFields) of
-	[] -&gt; {result, []};
-	[#xmlel{name = 'x'} = XEl] -&gt;
-	    case jlib:parse_xdata_submit(XEl) of
-		XData when is_list(XData) -&gt;
-		    case set_xoption(XData, []) of
-			Opts when is_list(Opts) -&gt; {result, Opts};
-			Other		   -&gt; Other
-		    end;
-		Other -&gt;
-		    Other
-	    end;
-	Other -&gt;
-	    Other
+    case XFields of
+  [] -&gt;  {result, []};
+  _  -&gt;  case exmpp_xml:get_child_elements(XFields) of
+	    [] -&gt; {result, []};
+	    [#xmlel{name = 'x'} = XEl] -&gt;
+	        case jlib:parse_xdata_submit(XEl) of
+		    XData when is_list(XData) -&gt;
+		        case set_xoption(XData, []) of
+			    Opts when is_list(Opts) -&gt; {result, Opts};
+			    Other		   -&gt; Other
+		        end;
+		    Other -&gt;
+		        Other
+	        end;
+	    Other -&gt;
+	        Other
+        end
     end.
 
 %%====================================================================</diff>
      <filename>src/mod_pubsub/pubsub_subscription.erl</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>3101d6bb6a062c7f8d701371d8a47b87b3237f28</id>
    </parent>
  </parents>
  <author>
    <name>cromain</name>
    <email>cromain@1613c18e-e6f4-0310-972c-c3fad1d2be73</email>
  </author>
  <url>http://github.com/bjc/ejabberd/commit/02c4221ad8cdf458505ec6a6c572bb5bb4a6e7bc</url>
  <id>02c4221ad8cdf458505ec6a6c572bb5bb4a6e7bc</id>
  <committed-date>2009-11-06T06:34:23-08:00</committed-date>
  <authored-date>2009-11-06T06:34:23-08:00</authored-date>
  <message>minor bug fixes related to the use/conversion of/to exmpp (thanks to Karim Gemayel)

git-svn-id: https://svn.process-one.net/ejabberd/trunk@2732 1613c18e-e6f4-0310-972c-c3fad1d2be73</message>
  <tree>da0eefb7c363f39eda3e7b159b12ec7b309c36f8</tree>
  <committer>
    <name>cromain</name>
    <email>cromain@1613c18e-e6f4-0310-972c-c3fad1d2be73</email>
  </committer>
</commit>
