aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlexey Shchepin <alexey@process-one.net>2005-04-19 22:19:22 +0000
committerAlexey Shchepin <alexey@process-one.net>2005-04-19 22:19:22 +0000
commitd5b0b5c42bad349103ce25017d0c703e20cb20e1 (patch)
tree1ce1c6afd243e0b11185764bebef1ae5efa52c6b /src
parentFixes a bug on the web interface: On user creation screen the user creation w... (diff)
* src/mod_disco.erl: Fixed domain listing when one virtual host is
a subdomain of another SVN Revision: 322
Diffstat (limited to 'src')
-rw-r--r--src/mod_disco.erl12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/mod_disco.erl b/src/mod_disco.erl
index 084b39da8..769dc0416 100644
--- a/src/mod_disco.erl
+++ b/src/mod_disco.erl
@@ -344,9 +344,17 @@ get_local_items(_Host, _, _, _) ->
get_vh_services(Host) ->
- DotHost = "." ++ Host,
+ Hosts = lists:sort(fun(H1, H2) -> length(H1) >= length(H2) end, ?MYHOSTS),
lists:filter(fun(H) ->
- lists:suffix(DotHost, H)
+ case lists:dropwhile(
+ fun(VH) ->
+ not lists:suffix("." ++ VH, H)
+ end, Hosts) of
+ [] ->
+ false;
+ [VH | _] ->
+ VH == Host
+ end
end, ejabberd_router:dirty_get_all_routes()).
get_online_vh_users(Host) ->