# HG changeset patch # User Matthew Wild # Date 1390274764 0 # Node ID 34f43c8167e5c23afe44f81acf50c6bd486b3888 # Parent 82555ae620dd9a69c9d4ef980c8aa30870f047e6# Parent 0f6399c86c10cbffb5d420268d58ef0c683079d0 Merge 0.10->trunk diff -r 82555ae620dd -r 34f43c8167e5 plugins/mod_storage_sql2.lua --- a/plugins/mod_storage_sql2.lua Sat Jan 18 18:46:31 2014 +0000 +++ b/plugins/mod_storage_sql2.lua Tue Jan 21 03:26:04 2014 +0000 @@ -222,9 +222,12 @@ end local user,store = username,self.store; return engine:transaction(function() - local key = key or uuid.generate(); + if key then + engine:delete("DELETE FROM `prosodyarchive` WHERE `host`=? AND `user`=? AND `store`=? AND `key`=?", host, user or "", store, key); + else + key = uuid.generate(); + end local t, value = serialize(value); - engine:delete("DELETE FROM `prosodyarchive` WHERE `host`=? AND `user`=? AND `store`=? AND KEY=?", host, user or "", store, key); engine:insert("INSERT INTO `prosodyarchive` (`host`, `user`, `store`, `when`, `with`, `key`, `type`, `value`) VALUES (?,?,?,?,?,?,?,?)", host, user or "", store, when, with, key, t, value); return key; end); diff -r 82555ae620dd -r 34f43c8167e5 plugins/muc/mod_muc.lua --- a/plugins/muc/mod_muc.lua Sat Jan 18 18:46:31 2014 +0000 +++ b/plugins/muc/mod_muc.lua Tue Jan 21 03:26:04 2014 +0000 @@ -173,6 +173,7 @@ if room then room:handle_stanza(origin, stanza); if not next(room._occupants) and not persistent_rooms[room.jid] then -- empty, non-persistent room + module:fire_event("muc-room-destroyed", { room = room }); rooms[bare] = nil; -- discard room end else diff -r 82555ae620dd -r 34f43c8167e5 tools/ejabberd2prosody.lua --- a/tools/ejabberd2prosody.lua Sat Jan 18 18:46:31 2014 +0000 +++ b/tools/ejabberd2prosody.lua Tue Jan 21 03:26:04 2014 +0000 @@ -30,7 +30,7 @@ function build_stanza(tuple, stanza) assert(type(tuple) == "table", "XML node is of unexpected type: "..type(tuple)); - if tuple[1] == "xmlelement" then + if tuple[1] == "xmlelement" or tuple[1] == "xmlel" then assert(type(tuple[2]) == "string", "element name has type: "..type(tuple[2])); assert(type(tuple[3]) == "table", "element attribute array has type: "..type(tuple[3])); assert(type(tuple[4]) == "table", "element children array has type: "..type(tuple[4])); @@ -247,7 +247,7 @@ end muc_room(tuple[2][1], tuple[2][2], properties); end; - config = function(tuple) + --[=[config = function(tuple) if tuple[2] == "hosts" then local output = io.output(); io.output("prosody.cfg.lua"); io.write("-- Configuration imported from ejabberd --\n"); @@ -275,7 +275,7 @@ io.output(output); print("prosody.cfg.lua created"); end - end; + end;]=] }; local arg = ...;