Made to match util.datamanager API
It's not a good api, but at least we can be consistent :)

diff -r bc12a8253f94 plugins/mod_storage_sql2.lua
--- a/plugins/mod_storage_sql2.lua Mon Apr 21 17:51:32 2014 -0400
+++ b/plugins/mod_storage_sql2.lua Mon Apr 21 18:07:29 2014 -0400
@@ -198,7 +198,9 @@
 keyval_store.__index = keyval_store;
 function keyval_store:get(username)
  user,store = username,self.store;
- return select(2, engine:transaction(keyval_store_get));
+ local ok, result = engine:transaction(keyval_store_get);
+ if not ok then return ok, result; end
+ return result;
 end
 function keyval_store:set(username, data)
  user,store = username,self.store;
diff -r bc12a8253f94 plugins/muc/mod_muc.lua
--- a/plugins/muc/mod_muc.lua Mon Apr 21 17:51:32 2014 -0400
+++ b/plugins/muc/mod_muc.lua Mon Apr 21 18:07:29 2014 -0400
@@ -36,6 +36,7 @@
 rooms = {};
 local rooms = rooms;
 local persistent_rooms_storage = module:open_store("persistent");
+-- FIXME: :get returns nil in case of error
 local persistent_rooms = persistent_rooms_storage:get() or {};
 local room_configs = module:open_store("config");

-- 
You received this message because you are subscribed to the Google Groups 
"prosody-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to prosody-dev+unsubscr...@googlegroups.com.
To post to this group, send email to prosody-dev@googlegroups.com.
Visit this group at http://groups.google.com/group/prosody-dev.
For more options, visit https://groups.google.com/d/optout.

Reply via email to