24
1
mirror of https://github.com/processone/ejabberd.git synced 2024-06-06 21:37:17 +02:00

fix hometree<->flat change

This commit is contained in:
Christophe Romain 2010-05-18 17:29:09 +02:00
parent 95057c1182
commit 5f89f481e4
6 changed files with 1295 additions and 1319 deletions

View File

@ -2213,7 +2213,7 @@ get_item(Host, Node, ItemId) ->
send_items(Host, Node, NodeId, Type, LJID, last) ->
Stanza = case get_cached_item(Host, NodeId) of
undefined ->
% special ODBC optimization, works only with node_flat_odbc, node_flat_odbc and node_pep_odbc
% special ODBC optimization, works only with node_hometree_odbc, node_flat_odbc and node_pep_odbc
case node_action(Host, Type, get_last_items, [NodeId, LJID, 1]) of
{result, [LastItem]} ->
{ModifNow, ModifLjid} = LastItem#pubsub_item.modification,

View File

@ -962,12 +962,19 @@ get_item_name(_Host, _Node, Id) ->
Id.
node_to_path(Node) ->
[list_to_binary(Item) || Item <- string:tokens(binary_to_list(Node), "/")].
[Node].
path_to_node([]) ->
<<>>;
path_to_node(Path) ->
list_to_binary(string:join([""|[binary_to_list(Item) || Item <- Path]], "/")).
case Path of
% default slot
[Node] -> Node;
% handle old possible entries, used when migrating database content to new format
[Node|_] when is_list(Node) -> list_to_binary(string:join([""|Path], "/"));
% default case (used by PEP for example)
_ -> list_to_binary(Path)
end.
%% @spec (Affiliation, Subscription) -> true | false
%% Affiliation = owner | member | publisher | outcast | none

File diff suppressed because it is too large Load Diff

View File

@ -210,14 +210,7 @@ get_item_name(Host, Node, Id) ->
node_flat:get_item_name(Host, Node, Id).
node_to_path(Node) ->
[Node].
[list_to_binary(Item) || Item <- string:tokens(binary_to_list(Node), "/")].
path_to_node(Path) ->
case Path of
% default slot
[Node] -> Node;
% handle old possible entries, used when migrating database content to new format
[Node|_] when is_list(Node) -> list_to_binary(string:join([""|Path], "/"));
% default case (used by PEP for example)
_ -> list_to_binary(Path)
end.
list_to_binary(string:join([""|[binary_to_list(Item) || Item <- Path]], "/")).

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
--- mod_pubsub.erl 2010-05-17 11:02:22.000000000 +0200
+++ mod_pubsub_odbc.erl 2010-05-17 11:02:08.000000000 +0200
--- mod_pubsub.erl 2010-05-17 22:05:12.000000000 +0200
+++ mod_pubsub_odbc.erl 2010-05-18 17:28:09.000000000 +0200
@@ -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.