]> granicus.if.org Git - ejabberd/commitdiff
* src/mod_disco.erl: Fixed domain listing when one virtual host is
authorAlexey Shchepin <alexey@process-one.net>
Tue, 19 Apr 2005 22:19:22 +0000 (22:19 +0000)
committerAlexey Shchepin <alexey@process-one.net>
Tue, 19 Apr 2005 22:19:22 +0000 (22:19 +0000)
a subdomain of another

SVN Revision: 322

ChangeLog
src/mod_disco.erl

index 581a16a50d59d5d907071184e693d671e32f97e3..6e373b4ddebf6faff372726fa079e267c91a8041 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2005-04-20  Alexey Shchepin  <alexey@sevcom.net>
+
+       * src/mod_disco.erl: Fixed domain listing when one virtual host is
+       a subdomain of another
+
 2005-04-18  Alexey Shchepin  <alexey@sevcom.net>
 
        * src/web/ejabberd_web_admin.erl: Added link to shared roster page
index 084b39da86046cdbe7683b9ae96415ddf3320071..769dc04165b7dbbea3bdb1c3310c628b71cd0a8e 100644 (file)
@@ -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) ->