From 5a006b977dd948db73ae68c52673e277ba2c7905 Mon Sep 17 00:00:00 2001 From: Badlop Date: Fri, 4 Dec 2009 16:08:31 +0000 Subject: [PATCH] Small relax the limitation in the mod_pubsub_odbc host option. SVN Revision: 2781 --- 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 4a2bfd22b..1a56ae7a4 100644 --- a/doc/guide.html +++ b/doc/guide.html @@ -2797,7 +2797,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 d8f7b2a5d..d2ddeda7e 100644 --- a/doc/guide.tex +++ b/doc/guide.tex @@ -3573,7 +3573,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 910ceda2e..0cbcdf38f 100644 --- a/src/mod_pubsub/mod_pubsub_odbc.erl +++ b/src/mod_pubsub/mod_pubsub_odbc.erl @@ -3557,7 +3557,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 9bd66e4f2..5d73dd1ba 100644 --- a/src/mod_pubsub/pubsub_odbc.patch +++ b/src/mod_pubsub/pubsub_odbc.patch @@ -760,7 +760,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)->