mod_welcome: Change $user to $username in default welcome message (thanks to neustrad...
[prosody.git] / prosody
diff --git a/prosody b/prosody
index 0618a1f3d3b52aa15750ba134edf08c4178b1fee..e7457627ad6098e34648c756d41d57034b94e53c 100755 (executable)
--- a/prosody
+++ b/prosody
@@ -93,6 +93,17 @@ function init_global_state()
 
        prosody.events = require "util.events".new();
        
+       prosody.platform = "unknown";
+       if os.getenv("WINDIR") then
+               prosody.platform = "windows";
+       elseif package.config:sub(1,1) == "/" then
+               prosody.platform = "posix";
+       end
+       
+       prosody.installed = nil;
+       if CFG_SOURCEDIR and (prosody.platform == "windows" or CFG_SOURCEDIR:match("^/")) then
+               prosody.installed = true;
+       end
        
        -- Function to reload the config file
        function prosody.reload_config()