aboutsummaryrefslogtreecommitdiff
path: root/src/mod_pubsub/pubsub_odbc.patch
diff options
context:
space:
mode:
authorChristophe Romain <christophe.romain@process-one.net>2010-12-07 14:00:40 +0100
committerChristophe Romain <christophe.romain@process-one.net>2010-12-07 14:00:40 +0100
commitfd828c3e9bd57c1ac0e0e4b118b266833519ec18 (patch)
tree0df6870e3e2be6f0e25228219e53ea4b50d352e1 /src/mod_pubsub/pubsub_odbc.patch
parentadd node attribute to pubsub subscribe event (EJAB-1361) (diff)
update pubsub_odbc patch
Diffstat (limited to 'src/mod_pubsub/pubsub_odbc.patch')
-rw-r--r--src/mod_pubsub/pubsub_odbc.patch92
1 files changed, 46 insertions, 46 deletions
diff --git a/src/mod_pubsub/pubsub_odbc.patch b/src/mod_pubsub/pubsub_odbc.patch
index 0e32e198c..998132f74 100644
--- a/src/mod_pubsub/pubsub_odbc.patch
+++ b/src/mod_pubsub/pubsub_odbc.patch
@@ -1,5 +1,5 @@
---- mod_pubsub.erl 2010-08-02 16:07:28.000000000 +0200
-+++ mod_pubsub_odbc.erl 2010-08-02 17:04:37.000000000 +0200
+--- mod_pubsub.erl 2010-12-07 13:54:26.000000000 +0100
++++ mod_pubsub_odbc.erl 2010-12-07 13:59:56.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.
@@ -49,7 +49,7 @@
init_nodes(Host, ServerHost, NodeTree, Plugins),
State = #state{host = Host,
server_host = ServerHost,
-@@ -277,207 +275,14 @@
+@@ -282,207 +280,14 @@
init_nodes(Host, ServerHost, _NodeTree, Plugins) ->
%% TODO, this call should be done plugin side
@@ -260,7 +260,7 @@
send_loop(State) ->
receive
{presence, JID, Pid} ->
-@@ -488,17 +293,15 @@
+@@ -493,17 +298,15 @@
%% for each node From is subscribed to
%% and if the node is so configured, send the last published item to From
lists:foreach(fun(PType) ->
@@ -284,7 +284,7 @@
true ->
% resource not concerned about that subscription
ok
-@@ -617,7 +420,8 @@
+@@ -622,7 +425,8 @@
disco_identity(_Host, <<>>, _From) ->
[{xmlelement, "identity", [{"category", "pubsub"}, {"type", "pep"}], []}];
disco_identity(Host, Node, From) ->
@@ -294,7 +294,7 @@
case get_allowed_items_call(Host, Idx, From, Type, Options, Owners) of
{result, _} ->
{result, [{xmlelement, "identity", [{"category", "pubsub"}, {"type", "pep"}], []},
-@@ -652,7 +456,8 @@
+@@ -657,7 +461,8 @@
[?NS_PUBSUB
| [?NS_PUBSUB++"#"++Feature || Feature <- features("pep")]];
disco_features(Host, Node, From) ->
@@ -304,7 +304,7 @@
case get_allowed_items_call(Host, Idx, From, Type, Options, Owners) of
{result, _} ->
{result, [?NS_PUBSUB
-@@ -677,7 +482,8 @@
+@@ -682,7 +487,8 @@
Acc.
disco_items(Host, <<>>, From) ->
@@ -314,7 +314,7 @@
case get_allowed_items_call(Host, Idx, From, Type, Options, Owners) of
{result, _} ->
[{xmlelement, "item",
-@@ -695,13 +501,14 @@
+@@ -700,13 +506,14 @@
_ -> Acc
end
end,
@@ -331,7 +331,7 @@
case get_allowed_items_call(Host, Idx, From, Type, Options, Owners) of
{result, Items} ->
{result, [{xmlelement, "item",
-@@ -781,10 +588,10 @@
+@@ -792,10 +599,10 @@
lists:foreach(fun(PType) ->
{result, Subscriptions} = node_action(Host, PType, get_entity_subscriptions, [Host, Entity]),
lists:foreach(fun
@@ -344,7 +344,7 @@
true ->
node_action(Host, PType, unsubscribe_node, [NodeId, Entity, JID, all]);
false ->
-@@ -952,7 +759,8 @@
+@@ -963,7 +770,8 @@
sub_el = SubEl} = IQ ->
{xmlelement, _, QAttrs, _} = SubEl,
Node = xml:get_attr_s("node", QAttrs),
@@ -354,7 +354,7 @@
{result, IQRes} ->
jlib:iq_to_xml(
IQ#iq{type = result,
-@@ -1065,7 +873,7 @@
+@@ -1076,7 +884,7 @@
[] ->
["leaf"]; %% No sub-nodes: it's a leaf node
_ ->
@@ -363,7 +363,7 @@
{result, []} -> ["collection"];
{result, _} -> ["leaf", "collection"];
_ -> []
-@@ -1081,8 +889,9 @@
+@@ -1092,8 +900,9 @@
[];
true ->
[{xmlelement, "feature", [{"var", ?NS_PUBSUB}], []} |
@@ -375,7 +375,7 @@
end, features(Type))]
end,
%% TODO: add meta-data info (spec section 5.4)
-@@ -1111,8 +920,9 @@
+@@ -1122,8 +931,9 @@
{xmlelement, "feature", [{"var", ?NS_PUBSUB}], []},
{xmlelement, "feature", [{"var", ?NS_COMMANDS}], []},
{xmlelement, "feature", [{"var", ?NS_VCARD}], []}] ++
@@ -387,7 +387,7 @@
end, features(Host, Node))};
<<?NS_COMMANDS>> ->
command_disco_info(Host, Node, From);
-@@ -1122,7 +932,7 @@
+@@ -1133,7 +943,7 @@
node_disco_info(Host, Node, From)
end.
@@ -396,7 +396,7 @@
case tree_action(Host, get_subnodes, [Host, <<>>, From]) of
Nodes when is_list(Nodes) ->
{result, lists:map(
-@@ -1139,23 +949,24 @@
+@@ -1150,23 +960,24 @@
Other ->
Other
end;
@@ -427,7 +427,7 @@
end,
Nodes = lists:map(
fun(#pubsub_node{nodeid = {_, SubNode}, options = SubOptions}) ->
-@@ -1173,7 +984,7 @@
+@@ -1184,7 +995,7 @@
{result, Name} = node_call(Type, get_item_name, [Host, Node, RN]),
{xmlelement, "item", [{"jid", Host}, {"name", Name}], []}
end, NodeItems),
@@ -436,7 +436,7 @@
end,
case transaction(Host, Node, Action, sync_dirty) of
{result, {_, Result}} -> {result, Result};
-@@ -1284,7 +1095,8 @@
+@@ -1295,7 +1106,8 @@
(_, Acc) ->
Acc
end, [], xml:remove_cdata(Els)),
@@ -446,7 +446,7 @@
{get, "subscriptions"} ->
get_subscriptions(Host, Node, From, Plugins);
{get, "affiliations"} ->
-@@ -1307,7 +1119,9 @@
+@@ -1318,7 +1130,9 @@
iq_pubsub_owner(Host, ServerHost, From, IQType, SubEl, Lang) ->
{xmlelement, _, _, SubEls} = SubEl,
@@ -457,7 +457,7 @@
case Action of
[{xmlelement, Name, Attrs, Els}] ->
Node = string_to_node(xml:get_attr_s("node", Attrs)),
-@@ -1437,7 +1251,8 @@
+@@ -1448,7 +1262,8 @@
_ -> []
end
end,
@@ -467,7 +467,7 @@
sync_dirty) of
{result, Res} -> Res;
Err -> Err
-@@ -1476,7 +1291,7 @@
+@@ -1487,7 +1302,7 @@
%%% authorization handling
@@ -476,7 +476,7 @@
Lang = "en", %% TODO fix
Stanza = {xmlelement, "message",
[],
-@@ -1505,7 +1320,7 @@
+@@ -1516,7 +1331,7 @@
[{xmlelement, "value", [], [{xmlcdata, "false"}]}]}]}]},
lists:foreach(fun(Owner) ->
ejabberd_router:route(service_jid(Host), jlib:make_jid(Owner), Stanza)
@@ -485,7 +485,7 @@
find_authorization_response(Packet) ->
{xmlelement, _Name, _Attrs, Els} = Packet,
-@@ -1569,8 +1384,8 @@
+@@ -1580,8 +1395,8 @@
"true" -> true;
_ -> false
end,
@@ -496,7 +496,7 @@
{result, Subscriptions} = node_call(Type, get_subscriptions, [NodeId, Subscriber]),
if
not IsApprover ->
-@@ -1769,7 +1584,7 @@
+@@ -1780,7 +1595,7 @@
Reply = [{xmlelement, "pubsub", [{"xmlns", ?NS_PUBSUB}],
[{xmlelement, "create", nodeAttr(Node),
[]}]}],
@@ -505,7 +505,7 @@
{result, {NodeId, SubsByDepth, {Result, broadcast}}} ->
broadcast_created_node(Host, Node, NodeId, Type, NodeOptions, SubsByDepth),
case Result of
-@@ -1872,7 +1687,7 @@
+@@ -1883,7 +1698,7 @@
%%<li>The node does not exist.</li>
%%</ul>
subscribe_node(Host, Node, From, JID, Configuration) ->
@@ -514,7 +514,7 @@
{result, GoodSubOpts} -> GoodSubOpts;
_ -> invalid
end,
-@@ -1880,7 +1695,7 @@
+@@ -1891,7 +1706,7 @@
error -> {"", "", ""};
J -> jlib:jid_tolower(J)
end,
@@ -523,7 +523,7 @@
Features = features(Type),
SubscribeFeature = lists:member("subscribe", Features),
OptionsFeature = lists:member("subscription-options", Features),
-@@ -1889,6 +1704,7 @@
+@@ -1900,6 +1715,7 @@
AccessModel = get_option(Options, access_model),
SendLast = get_option(Options, send_last_published_item),
AllowedGroups = get_option(Options, roster_groups_allowed, []),
@@ -531,7 +531,7 @@
{PresenceSubscription, RosterGroup} = get_presence_and_roster_permissions(Host, Subscriber, Owners, AccessModel, AllowedGroups),
if
not SubscribeFeature ->
-@@ -2218,7 +2034,7 @@
+@@ -2231,7 +2047,7 @@
%% <p>The permission are not checked in this function.</p>
%% @todo We probably need to check that the user doing the query has the right
%% to read the items.
@@ -540,7 +540,7 @@
MaxItems =
if
SMaxItems == "" -> get_max_items_node(Host);
-@@ -2232,12 +2048,13 @@
+@@ -2245,12 +2061,13 @@
{error, Error} ->
{error, Error};
_ ->
@@ -555,7 +555,7 @@
{PresenceSubscription, RosterGroup} = get_presence_and_roster_permissions(Host, From, Owners, AccessModel, AllowedGroups),
if
not RetreiveFeature ->
-@@ -2250,11 +2067,11 @@
+@@ -2263,11 +2080,11 @@
node_call(Type, get_items,
[NodeId, From,
AccessModel, PresenceSubscription, RosterGroup,
@@ -569,7 +569,7 @@
SendItems = case ItemIDs of
[] ->
Items;
-@@ -2267,7 +2084,8 @@
+@@ -2280,7 +2097,8 @@
%% number of items sent to MaxItems:
{result, [{xmlelement, "pubsub", [{"xmlns", ?NS_PUBSUB}],
[{xmlelement, "items", nodeAttr(Node),
@@ -579,7 +579,7 @@
Error ->
Error
end
-@@ -2289,10 +2107,15 @@
+@@ -2302,10 +2120,15 @@
Error -> Error
end.
get_allowed_items_call(Host, NodeIdx, From, Type, Options, Owners) ->
@@ -596,7 +596,7 @@
%% @spec (Host, Node, NodeId, Type, LJID, Number) -> any()
-@@ -2305,16 +2128,27 @@
+@@ -2318,16 +2141,27 @@
%% @doc <p>Resend the items of a node to the user.</p>
%% @todo use cache-last-item feature
send_items(Host, Node, NodeId, Type, LJID, last) ->
@@ -630,7 +630,7 @@
send_items(Host, Node, NodeId, Type, LJID, Number) ->
ToSend = case node_action(Host, Type, get_items, [NodeId, LJID]) of
{result, []} ->
-@@ -2440,7 +2274,8 @@
+@@ -2453,7 +2287,8 @@
error ->
{error, ?ERR_BAD_REQUEST};
_ ->
@@ -640,7 +640,7 @@
case lists:member(Owner, Owners) of
true ->
OwnerJID = jlib:make_jid(Owner),
-@@ -2450,24 +2285,7 @@
+@@ -2463,24 +2298,7 @@
end,
lists:foreach(
fun({JID, Affiliation}) ->
@@ -666,7 +666,7 @@
end, FilteredEntities),
{result, []};
_ ->
-@@ -2520,11 +2338,11 @@
+@@ -2533,11 +2351,11 @@
end.
read_sub(Subscriber, Node, NodeID, SubID, Lang) ->
@@ -680,7 +680,7 @@
OptionsEl = {xmlelement, "options", [{"jid", jlib:jid_to_string(Subscriber)},
{"subid", SubID}|nodeAttr(Node)],
[XdataEl]},
-@@ -2550,7 +2368,7 @@
+@@ -2563,7 +2381,7 @@
end.
set_options_helper(Configuration, JID, NodeID, SubID, Type) ->
@@ -689,7 +689,7 @@
{result, GoodSubOpts} -> GoodSubOpts;
_ -> invalid
end,
-@@ -2579,7 +2397,7 @@
+@@ -2592,7 +2410,7 @@
write_sub(_Subscriber, _NodeID, _SubID, invalid) ->
{error, extended_error(?ERR_BAD_REQUEST, "invalid-options")};
write_sub(Subscriber, NodeID, SubID, Options) ->
@@ -698,7 +698,7 @@
{error, notfound} ->
{error, extended_error(?ERR_NOT_ACCEPTABLE, "invalid-subid")};
{result, _} ->
-@@ -2747,8 +2565,8 @@
+@@ -2760,8 +2578,8 @@
{"subscription", subscription_to_string(Sub)} | nodeAttr(Node)], []}]}]},
ejabberd_router:route(service_jid(Host), jlib:make_jid(JID), Stanza)
end,
@@ -709,7 +709,7 @@
true ->
Result = lists:foldl(fun({JID, Subscription, SubId}, Acc) ->
-@@ -3103,7 +2921,7 @@
+@@ -3116,7 +2934,7 @@
{Depth, [{N, get_node_subs(N)} || N <- Nodes]}
end, tree_call(Host, get_parentnodes_tree, [Host, Node, service_jid(Host)]))}
end,
@@ -718,7 +718,7 @@
{result, CollSubs} -> CollSubs;
_ -> []
end.
-@@ -3117,9 +2935,9 @@
+@@ -3130,9 +2948,9 @@
get_options_for_subs(NodeID, Subs) ->
lists:foldl(fun({JID, subscribed, SubID}, Acc) ->
@@ -730,7 +730,7 @@
_ -> Acc
end;
(_, Acc) ->
-@@ -3323,6 +3141,30 @@
+@@ -3321,6 +3139,30 @@
Result
end.
@@ -761,7 +761,7 @@
%% @spec (Host, Options) -> MaxItems
%% Host = host()
%% Options = [Option]
-@@ -3719,7 +3561,13 @@
+@@ -3717,7 +3559,13 @@
tree_action(Host, Function, Args) ->
?DEBUG("tree_action ~p ~p ~p",[Host,Function,Args]),
Fun = fun() -> tree_call(Host, Function, Args) end,
@@ -776,7 +776,7 @@
%% @doc <p>node plugin call.</p>
node_call(Type, Function, Args) ->
-@@ -3739,13 +3587,13 @@
+@@ -3737,13 +3585,13 @@
node_action(Host, Type, Function, Args) ->
?DEBUG("node_action ~p ~p ~p ~p",[Host,Type,Function,Args]),
@@ -792,7 +792,7 @@
case tree_call(Host, get_node, [Host, Node]) of
N when is_record(N, pubsub_node) ->
case Action(N) of
-@@ -3757,13 +3605,19 @@
+@@ -3755,13 +3603,19 @@
Error
end
end, Trans).
@@ -816,7 +816,7 @@
{result, Result} -> {result, Result};
{error, Error} -> {error, Error};
{atomic, {result, Result}} -> {result, Result};
-@@ -3771,6 +3625,15 @@
+@@ -3769,6 +3623,15 @@
{aborted, Reason} ->
?ERROR_MSG("transaction return internal error: ~p~n", [{aborted, Reason}]),
{error, ?ERR_INTERNAL_SERVER_ERROR};
@@ -832,7 +832,7 @@
{'EXIT', Reason} ->
?ERROR_MSG("transaction return internal error: ~p~n", [{'EXIT', Reason}]),
{error, ?ERR_INTERNAL_SERVER_ERROR};
-@@ -3779,6 +3642,17 @@
+@@ -3777,6 +3640,17 @@
{error, ?ERR_INTERNAL_SERVER_ERROR}
end.