]> granicus.if.org Git - ejabberd/commitdiff
fix r2876 compilation warning
authorChristophe Romain <christophe.romain@process-one.net>
Tue, 12 Jan 2010 12:31:08 +0000 (12:31 +0000)
committerChristophe Romain <christophe.romain@process-one.net>
Tue, 12 Jan 2010 12:31:08 +0000 (12:31 +0000)
SVN Revision: 2880

src/mod_pubsub/mod_pubsub.erl
src/mod_pubsub/mod_pubsub_odbc.erl
src/mod_pubsub/pubsub_odbc.patch

index c9621b74babb30fca46874e2b6093186fc469e0e..7f32a5732bc1eb81104e2730c03f806f0220683d 100644 (file)
@@ -3170,49 +3170,49 @@ broadcast_stanza(Host, Node, _NodeId, _Type, NodeOptions, SubsByDepth, NotifyTyp
 
 subscribed_nodes_by_jid(NotifyType, SubsByDepth) ->
     NodesToDeliver = fun(Depth, Node, Subs, Acc) ->
-               NodeId = case Node#pubsub_node.nodeid of
-                   {_, N} -> N;
-                   Other -> Other
-               end,
-               NodeOptions = Node#pubsub_node.options,
-         lists:foldl(
-           fun({LJID, SubID, SubOptions}, {JIDs, Recipients} = Acc) ->
-                  case is_to_deliver(LJID, NotifyType, Depth,  NodeOptions, SubOptions) of
-                   true  ->
-                     %% If is to deliver :
-                     case lists:member(LJID, JIDs) of
-              %% check if the JIDs co-accumulator contains the Subscription Jid,
-                       false ->
-                %%  - if not,
-                %%       - add the Jid to JIDs list co-accumulator ;
-                %%       - create a tuple of the Jid, NodeId, and SubID (as list),
-                %%         and add the tuple to the Recipients list co-accumulator
-                         {[LJID | JIDs], [{LJID, [SubID]} | Recipients]};
-                       true ->
-                         %% - if the JIDs co-accumulator contains the Jid
-                         %%   get the tuple containing the Jid from the Recipient list co-accumulator
-                         {_, {LJID, SubIDs}} = lists:keysearch(LJID, 1, Recipients),
-                         %%   delete the tuple from the Recipients list
-                         % v1 : Recipients1 = lists:keydelete(LJID, 1, Recipients),
-                         % v2 : Recipients1 = lists:keyreplace(LJID, 1, Recipients, {LJID, NodeId1, [SubID | SubIDs]}),
-                         %%   add the SubID to the SubIDs list in the tuple,
-                         %%   and add the tuple back to the Recipients list co-accumulator
-                         % v1.1 : {JIDs, lists:append(Recipients1, [{LJID, NodeId1, lists:append(SubIDs, [SubID])}])}
-                         % v1.2 : {JIDs, [{LJID, NodeId1, [SubID | SubIDs]} | Recipients1]}
-                         % v2: {JIDs, Recipients1}
-                         {JIDs, lists:keyreplace(LJID, 1, Recipients, {LJID, [SubID | SubIDs]})}
-                     end;
-                   false -> {JIDs, Recipients}
-                   end
-                 end, Acc, Subs)
+%          NodeId = case Node#pubsub_node.nodeid of
+%              {_, N} -> N;
+%              Other -> Other
+%          end,
+           NodeOptions = Node#pubsub_node.options,
+           lists:foldl(fun({LJID, SubID, SubOptions}, {JIDs, Recipients}) ->
+               case is_to_deliver(LJID, NotifyType, Depth, NodeOptions, SubOptions) of
+               true  ->
+                   %% If is to deliver :
+                   case lists:member(LJID, JIDs) of
+                   %% check if the JIDs co-accumulator contains the Subscription Jid,
+                   false ->
+                       %%  - if not,
+                       %%  - add the Jid to JIDs list co-accumulator ;
+                       %%  - create a tuple of the Jid, NodeId, and SubID (as list),
+                       %%    and add the tuple to the Recipients list co-accumulator
+                       {[LJID | JIDs], [{LJID, [SubID]} | Recipients]};
+                   true ->
+                       %% - if the JIDs co-accumulator contains the Jid
+                       %%   get the tuple containing the Jid from the Recipient list co-accumulator
+                       {_, {LJID, SubIDs}} = lists:keysearch(LJID, 1, Recipients),
+                       %%   delete the tuple from the Recipients list
+                       % v1 : Recipients1 = lists:keydelete(LJID, 1, Recipients),
+                       % v2 : Recipients1 = lists:keyreplace(LJID, 1, Recipients, {LJID, NodeId1, [SubID | SubIDs]}),
+                       %%   add the SubID to the SubIDs list in the tuple,
+                       %%   and add the tuple back to the Recipients list co-accumulator
+                       % v1.1 : {JIDs, lists:append(Recipients1, [{LJID, NodeId1, lists:append(SubIDs, [SubID])}])}
+                       % v1.2 : {JIDs, [{LJID, NodeId1, [SubID | SubIDs]} | Recipients1]}
+                       % v2: {JIDs, Recipients1}
+                       {JIDs, lists:keyreplace(LJID, 1, Recipients, {LJID, [SubID | SubIDs]})}
+                   end;
+               false ->
+                   {JIDs, Recipients}
+               end
+           end, Acc, Subs)
        end,
     DepthsToDeliver = fun({Depth, SubsByNode}, Acc) ->
-               lists:foldl(fun({Node, Subs}, Acc2) ->
-                                   NodesToDeliver(Depth, Node, Subs, Acc2)
-                           end, Acc, SubsByNode)
+           lists:foldl(fun({Node, Subs}, Acc2) ->
+                   NodesToDeliver(Depth, Node, Subs, Acc2)
+           end, Acc, SubsByNode)
        end,
-  {_, JIDSubs} = lists:foldl(DepthsToDeliver, {[], []}, SubsByDepth),
-  JIDSubs.
+    {_, JIDSubs} = lists:foldl(DepthsToDeliver, {[], []}, SubsByDepth),
+    JIDSubs.
 
 %% If we don't know the resource, just pick first if any
 %% If no resource available, check if caps anyway (remote online)
index 6e3037874fe13f1b4527b68c98095fe687e6e5be..20b0c9fde968bb3997d56aa2d809aa5f51b7f7c3 100644 (file)
@@ -2979,49 +2979,49 @@ broadcast_stanza(Host, Node, _NodeId, _Type, NodeOptions, SubsByDepth, NotifyTyp
 
 subscribed_nodes_by_jid(NotifyType, SubsByDepth) ->
     NodesToDeliver = fun(Depth, Node, Subs, Acc) ->
-               NodeId = case Node#pubsub_node.nodeid of
-                   {_, N} -> N;
-                   Other -> Other
-               end,
-               NodeOptions = Node#pubsub_node.options,
-         lists:foldl(
-           fun({LJID, SubID, SubOptions}, {JIDs, Recipients} = Acc) ->
-                  case is_to_deliver(LJID, NotifyType, Depth,  NodeOptions, SubOptions) of
-                   true  ->
-                     %% If is to deliver :
-                     case lists:member(LJID, JIDs) of
-              %% check if the JIDs co-accumulator contains the Subscription Jid,
-                       false ->
-                %%  - if not,
-                %%       - add the Jid to JIDs list co-accumulator ;
-                %%       - create a tuple of the Jid, NodeId, and SubID (as list),
-                %%         and add the tuple to the Recipients list co-accumulator
-                         {[LJID | JIDs], [{LJID, [SubID]} | Recipients]};
-                       true ->
-                         %% - if the JIDs co-accumulator contains the Jid
-                         %%   get the tuple containing the Jid from the Recipient list co-accumulator
-                         {_, {LJID, SubIDs}} = lists:keysearch(LJID, 1, Recipients),
-                         %%   delete the tuple from the Recipients list
-                         % v1 : Recipients1 = lists:keydelete(LJID, 1, Recipients),
-                         % v2 : Recipients1 = lists:keyreplace(LJID, 1, Recipients, {LJID, NodeId1, [SubID | SubIDs]}),
-                         %%   add the SubID to the SubIDs list in the tuple,
-                         %%   and add the tuple back to the Recipients list co-accumulator
-                         % v1.1 : {JIDs, lists:append(Recipients1, [{LJID, NodeId1, lists:append(SubIDs, [SubID])}])}
-                         % v1.2 : {JIDs, [{LJID, NodeId1, [SubID | SubIDs]} | Recipients1]}
-                         % v2: {JIDs, Recipients1}
-                         {JIDs, lists:keyreplace(LJID, 1, Recipients, {LJID, [SubID | SubIDs]})}
-                     end;
-                   false -> {JIDs, Recipients}
-                   end
-                 end, Acc, Subs)
+%          NodeId = case Node#pubsub_node.nodeid of
+%              {_, N} -> N;
+%              Other -> Other
+%          end,
+           NodeOptions = Node#pubsub_node.options,
+           lists:foldl(fun({LJID, SubID, SubOptions}, {JIDs, Recipients}) ->
+               case is_to_deliver(LJID, NotifyType, Depth, NodeOptions, SubOptions) of
+               true  ->
+                   %% If is to deliver :
+                   case lists:member(LJID, JIDs) of
+                   %% check if the JIDs co-accumulator contains the Subscription Jid,
+                   false ->
+                       %%  - if not,
+                       %%  - add the Jid to JIDs list co-accumulator ;
+                       %%  - create a tuple of the Jid, NodeId, and SubID (as list),
+                       %%    and add the tuple to the Recipients list co-accumulator
+                       {[LJID | JIDs], [{LJID, [SubID]} | Recipients]};
+                   true ->
+                       %% - if the JIDs co-accumulator contains the Jid
+                       %%   get the tuple containing the Jid from the Recipient list co-accumulator
+                       {_, {LJID, SubIDs}} = lists:keysearch(LJID, 1, Recipients),
+                       %%   delete the tuple from the Recipients list
+                       % v1 : Recipients1 = lists:keydelete(LJID, 1, Recipients),
+                       % v2 : Recipients1 = lists:keyreplace(LJID, 1, Recipients, {LJID, NodeId1, [SubID | SubIDs]}),
+                       %%   add the SubID to the SubIDs list in the tuple,
+                       %%   and add the tuple back to the Recipients list co-accumulator
+                       % v1.1 : {JIDs, lists:append(Recipients1, [{LJID, NodeId1, lists:append(SubIDs, [SubID])}])}
+                       % v1.2 : {JIDs, [{LJID, NodeId1, [SubID | SubIDs]} | Recipients1]}
+                       % v2: {JIDs, Recipients1}
+                       {JIDs, lists:keyreplace(LJID, 1, Recipients, {LJID, [SubID | SubIDs]})}
+                   end;
+               false ->
+                   {JIDs, Recipients}
+               end
+           end, Acc, Subs)
        end,
     DepthsToDeliver = fun({Depth, SubsByNode}, Acc) ->
-               lists:foldl(fun({Node, Subs}, Acc2) ->
-                                   NodesToDeliver(Depth, Node, Subs, Acc2)
-                           end, Acc, SubsByNode)
+           lists:foldl(fun({Node, Subs}, Acc2) ->
+                   NodesToDeliver(Depth, Node, Subs, Acc2)
+           end, Acc, SubsByNode)
        end,
-  {_, JIDSubs} = lists:foldl(DepthsToDeliver, {[], []}, SubsByDepth),
-  JIDSubs.
+    {_, JIDSubs} = lists:foldl(DepthsToDeliver, {[], []}, SubsByDepth),
+    JIDSubs.
 
 %% If we don't know the resource, just pick first if any
 %% If no resource available, check if caps anyway (remote online)
index 619c9b9ae997867f61102712bc6571ad2d2a5461..e8a630b0db0f3efd7200fb54ed3cca8b55227d95 100644 (file)
@@ -1,5 +1,5 @@
---- mod_pubsub.erl     2010-01-12 11:24:41.169047172 +0100
-+++ mod_pubsub_odbc.erl        2010-01-12 13:11:52.450026878 +0100
+--- mod_pubsub.erl     2010-01-12 13:29:25.458216046 +0100
++++ mod_pubsub_odbc.erl        2010-01-12 13:30:14.538046934 +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.