Merge with 0.6
authorMatthew Wild <mwild1@gmail.com>
Thu, 25 Feb 2010 18:03:15 +0000 (18:03 +0000)
committerMatthew Wild <mwild1@gmail.com>
Thu, 25 Feb 2010 18:03:15 +0000 (18:03 +0000)
1  2 
core/s2smanager.lua
plugins/mod_offline.lua
prosody

index 875a6bdc6d69eb033516cf0e250a80e214a1975a,bfa3069a6ddaea66c3939bdf66edca77b4176787..16ede7b611653ce72ccdfd343f7193260bb661fc
@@@ -48,9 -50,11 +48,11 @@@ local incoming_s2s = incoming_s2s
  
  module "s2smanager"
  
- local function compare_srv_priorities(a,b) return a.priority < b.priority or a.weight < b.weight; end
+ function compare_srv_priorities(a,b)
+       return a.priority < b.priority or (a.priority == b.priority and a.weight > b.weight);
+ end
  
 -local function bounce_sendq(session)
 +local function bounce_sendq(session, reason)
        local sendq = session.sendq;
        if sendq then
                session.log("info", "sending error replies for "..#sendq.." queued stanzas because of failed outgoing connection to "..tostring(session.to_host));
diff --cc plugins/mod_offline.lua
index c74d011e7c0b2145bf66328d2c42c693e9bfcca4,c74d011e7c0b2145bf66328d2c42c693e9bfcca4..0000000000000000000000000000000000000000
deleted file mode 100644,100644
+++ /dev/null
@@@ -1,56 -1,56 +1,0 @@@
---- Prosody IM
---- Copyright (C) 2008-2009 Matthew Wild
---- Copyright (C) 2008-2009 Waqas Hussain
---- 
---- This project is MIT/X11 licensed. Please see the
---- COPYING file in the source package for more information.
----
--
--\r
--local datamanager = require "util.datamanager";\r
--local st = require "util.stanza";\r
--local datetime = require "util.datetime";\r
--local ipairs = ipairs;
--local jid_split = require "util.jid".split;\r
--\r
--module:add_feature("msgoffline");\r
--\r
--module:hook("message/offline/store", function(event)\r
--      local origin, stanza = event.origin, event.stanza;\r
--      local to = stanza.attr.to;\r
--      local node, host;\r
--      if to then\r
--              node, host = jid_split(to)\r
--      else\r
--              node, host = origin.username, origin.host;\r
--      end\r
--      \r
--      stanza.attr.stamp, stanza.attr.stamp_legacy = datetime.datetime(), datetime.legacy();\r
--      local result = datamanager.list_append(node, host, "offline", st.preserialize(stanza));\r
--      stanza.attr.stamp, stanza.attr.stamp_legacy = nil, nil;\r
--      \r
--      return true;\r
--end);\r
--\r
--module:hook("message/offline/broadcast", function(event)\r
--      local origin = event.origin;\r
--      local node, host = origin.username, origin.host;\r
--      \r
--      local data = datamanager.list_load(node, host, "offline");\r
--      if not data then return true; end\r
--      for _, stanza in ipairs(data) do\r
--              stanza = st.deserialize(stanza);\r
--              stanza:tag("delay", {xmlns = "urn:xmpp:delay", from = host, stamp = stanza.attr.stamp}):up(); -- XEP-0203\r
--              stanza:tag("x", {xmlns = "jabber:x:delay", from = host, stamp = stanza.attr.stamp_legacy}):up(); -- XEP-0091 (deprecated)\r
--              stanza.attr.stamp, stanza.attr.stamp_legacy = nil, nil;\r
--              origin.send(stanza);\r
--      end\r
--      return true;\r
--end);\r
--\r
--module:hook("message/offline/delete", function(event)\r
--      local origin = event.origin;\r
--      local node, host = origin.username, origin.host;\r
--\r
--      return datamanager.list_store(node, host, "offline", nil);\r
--end);\r
diff --cc prosody
index 47b042d3953f1078a14f634b2023c688aba627c2,7f69e085bdcb8408536b9961fdab455e5f92b3a3..49580bd91deafd9b36a0eac4acaf6cb8a0319f48
+++ b/prosody
@@@ -22,7 -21,9 +22,10 @@@ if CFG_SOURCEDIR the
        package.cpath = CFG_SOURCEDIR.."/?.so;"..package.cpath;
  end
  
+ package.path = package.path..";"..(CFG_SOURCEDIR or ".").."/fallbacks/?.lua";
+ package.cpath = package.cpath..";"..(CFG_SOURCEDIR or ".").."/fallbacks/?.so";
 +-- Substitute ~ with path to home directory in data path
  if CFG_DATADIR then
        if os.getenv("HOME") then
                CFG_DATADIR = CFG_DATADIR:gsub("^~", os.getenv("HOME"));