diff options
author | Christophe Romain <christophe.romain@process-one.net> | 2009-08-27 10:20:05 +0000 |
---|---|---|
committer | Christophe Romain <christophe.romain@process-one.net> | 2009-08-27 10:20:05 +0000 |
commit | 51e28969144af8a79d28b6bb8531dd79d8e5e840 (patch) | |
tree | 937c7eb3dfaca207e98f7b0dc916b12bb135a4bd /src | |
parent | typo fix (diff) |
fix pep not fetching subscriptions
SVN Revision: 2551
Diffstat (limited to 'src')
-rw-r--r-- | src/mod_pubsub/node_pep_odbc.erl | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/mod_pubsub/node_pep_odbc.erl b/src/mod_pubsub/node_pep_odbc.erl index cbb3a81f..526986f4 100644 --- a/src/mod_pubsub/node_pep_odbc.erl +++ b/src/mod_pubsub/node_pep_odbc.erl @@ -196,24 +196,24 @@ get_entity_subscriptions(_Host, Owner) -> GJ = node_hometree_odbc:encode_jid(GenKey), Query = case SubKey of GenKey -> - ["select host, node, type, i.nodeid, jid, subscription " + ["select host, node, type, i.nodeid, jid, subscriptions " "from pubsub_state i, pubsub_node n " "where i.nodeid = n.nodeid " "and jid like '", GJ, "%' " "and host like '%@", Host, "';"]; _ -> - ["select host, node, type, i.nodeid, jid, subscription " + ["select host, node, type, i.nodeid, jid, subscriptions " "from pubsub_state i, pubsub_node n " "where i.nodeid = n.nodeid " "and jid in ('", SJ, "', '", GJ, "') " "and host like '%@", Host, "';"] end, Reply = case catch ejabberd_odbc:sql_query_t(Query) of - {selected, ["host", "node", "type", "nodeid", "jid", "subscription"], RItems} -> + {selected, ["host", "node", "type", "nodeid", "jid", "subscriptions"], RItems} -> lists:map(fun({H, N, T, I, J, S}) -> O = node_hometree_odbc:decode_jid(H), Node = nodetree_odbc:raw_to_node(O, {N, "", T, I}), - {Node, node_hometree_odbc:decode_subscription(S), node_hometree_odbc:decode_jid(J)} + {Node, node_hometree_odbc:decode_subscriptions(S), node_hometree_odbc:decode_jid(J)} end, RItems); _ -> [] @@ -228,14 +228,14 @@ get_entity_subscriptions_for_send_last(_Host, Owner) -> GJ = node_hometree_odbc:encode_jid(GenKey), Query = case SubKey of GenKey -> - ["select host, node, type, i.nodeid, jid, subscription " + ["select host, node, type, i.nodeid, jid, subscriptions " "from pubsub_state i, pubsub_node n, pubsub_node_option o " "where i.nodeid = n.nodeid and n.nodeid = o.nodeid " "and name='send_last_published_item' and val='on_sub_and_presence' " "and jid like '", GJ, "%' " "and host like '%@", Host, "';"]; _ -> - ["select host, node, type, i.nodeid, jid, subscription " + ["select host, node, type, i.nodeid, jid, subscriptions " "from pubsub_state i, pubsub_node n, pubsub_node_option o " "where i.nodeid = n.nodeid and n.nodeid = o.nodeid " "and name='send_last_published_item' and val='on_sub_and_presence' " @@ -243,11 +243,11 @@ get_entity_subscriptions_for_send_last(_Host, Owner) -> "and host like '%@", Host, "';"] end, Reply = case catch ejabberd_odbc:sql_query_t(Query) of - {selected, ["host", "node", "type", "nodeid", "jid", "subscription"], RItems} -> + {selected, ["host", "node", "type", "nodeid", "jid", "subscriptions"], RItems} -> lists:map(fun({H, N, T, I, J, S}) -> O = node_hometree_odbc:decode_jid(H), Node = nodetree_odbc:raw_to_node(O, {N, "", T, I}), - {Node, node_hometree_odbc:decode_subscription(S), node_hometree_odbc:decode_jid(J)} + {Node, node_hometree_odbc:decode_subscriptions(S), node_hometree_odbc:decode_jid(J)} end, RItems); _ -> [] |