comparison storage.js @ 10:44889cfb2f8c

Fix getItem method.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Fri, 27 Aug 2010 01:02:56 +0200
parents a6429f48e403
children 9a6b8b3357c6
comparison
equal deleted inserted replaced
9:a6429f48e403 10:44889cfb2f8c
286 return items[i]; 286 return items[i];
287 return false; 287 return false;
288 }; 288 };
289 289
290 storage.getItem = function(nodeID, itemID) { 290 storage.getItem = function(nodeID, itemID) {
291 if (!storage.existsItem(nodeID, itemID)) 291 var items = storage.getItems(nodeID);
292 return 42; //FIXME
293
294 var items = storage.existsItem(nodeID, itemID);
295 if (typeof items == 'number') 292 if (typeof items == 'number')
296 return items; 293 return items;
297 294
298 if (items) 295 if (items[itemID])
299 return items.content; 296 return items[itemID].content;
300 297
301 return errors.item_not_found; 298 return errors.success;
302 }; 299 };
303 300
304 storage.getSubscription = function(jid, nodeID) { 301 storage.getSubscription = function(jid, nodeID) {
305 var subs = {}; 302 var subs = {};
306 if (nodeID) { 303 if (nodeID) {