Software /
code /
prosody
Changeset
6001:34f43c8167e5
Merge 0.10->trunk
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Tue, 21 Jan 2014 03:26:04 +0000 |
parents | 5994:82555ae620dd (current diff) 6000:0f6399c86c10 (diff) |
children | 6008:e6f735c62c5d |
files | |
diffstat | 3 files changed, 9 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- 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);
--- 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
--- 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 = ...;