From c3df4f3eb0e484bc45b185fcf648a4328e2d15be Mon Sep 17 00:00:00 2001 From: Badlop Date: Fri, 4 Dec 2009 16:07:43 +0000 Subject: [PATCH] Small relax the limitation in the mod_pubsub_odbc host option. SVN Revision: 2780 --- doc/guide.html | 3 ++- doc/guide.tex | 3 ++- src/mod_pubsub/mod_pubsub_odbc.erl | 2 +- src/mod_pubsub/pubsub_odbc.patch | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/doc/guide.html b/doc/guide.html index 7733c4018..8053277a5 100644 --- a/doc/guide.html +++ b/doc/guide.html @@ -2717,7 +2717,8 @@ service. If the host option is not specified, the Jabber ID will be the hostname of the virtual host with the prefix ‘pubsub.’. The keyword "@HOST@" is replaced at start time with the real virtual host name. -If you use mod_pubsub_odbc, you can only use the prefix ‘pubsub.’. +If you use mod_pubsub_odbc, please ensure the prefix contains only one dot, +for example ‘pubsub.’, or ‘publish.’,.
{access_createnode, AccessName}
This option restricts which users are allowed to create pubsub nodes using ACL and ACCESS. diff --git a/doc/guide.tex b/doc/guide.tex index 04142f03e..0e0ddb03a 100644 --- a/doc/guide.tex +++ b/doc/guide.tex @@ -3479,7 +3479,8 @@ and it requires \modcaps{}. Options: \begin{description} \hostitem{pubsub} - If you use \modpubsubodbc, you can only use the prefix `\jid{pubsub.}'. + If you use \modpubsubodbc, please ensure the prefix contains only one dot, + for example `\jid{pubsub.}', or `\jid{publish.}',. \titem{\{access\_createnode, AccessName\}} \ind{options!access\_createnode} This option restricts which users are allowed to create pubsub nodes using ACL and ACCESS. diff --git a/src/mod_pubsub/mod_pubsub_odbc.erl b/src/mod_pubsub/mod_pubsub_odbc.erl index b1f96c33b..3bcafd3c8 100644 --- a/src/mod_pubsub/mod_pubsub_odbc.erl +++ b/src/mod_pubsub/mod_pubsub_odbc.erl @@ -3630,7 +3630,7 @@ transaction_retry(Host, Fun, Trans, Count) -> odbc_conn({_U, Host, _R})-> Host; odbc_conn(Host) -> - Host--"pubsub.". %% TODO, improve that for custom host + lists:dropwhile(fun(A) -> A/=$. end, Host) -- ".". %% escape value for database storage escape({_U, _H, _R}=JID)-> diff --git a/src/mod_pubsub/pubsub_odbc.patch b/src/mod_pubsub/pubsub_odbc.patch index df5bf22d3..368866d30 100644 --- a/src/mod_pubsub/pubsub_odbc.patch +++ b/src/mod_pubsub/pubsub_odbc.patch @@ -812,7 +812,7 @@ +odbc_conn({_U, Host, _R})-> + Host; +odbc_conn(Host) -> -+ Host--"pubsub.". %% TODO, improve that for custom host ++ lists:dropwhile(fun(A) -> A/=$. end, Host) -- ".". + +%% escape value for database storage +escape({_U, _H, _R}=JID)->