var redis = require('redis');

/*
 * GET home page.
 */

exports.index = function(req, res){
	redis.client.multi().keys('messages.*', function (err, replies) {
		// NOTE: code in this callback is NOT atomic
		// this only happens after the the .exec call finishes.]

		redis.client.mget(replies, function(err, result) {
			var json = new Array();
			for (var i = 0; i < result.length; i++){
				json.push(result[i])
			}
			res.render('index', {guestMessages:json});
		});
	})
	.exec(function (err, replies) {
		replies.forEach(function (reply, index) {
			
		});
	});
};
@@ -384,16 +384,99 @@
 ; i++)%7B%0A
+%09%09%09%09var jsonObject = JSON.parse(result%5Bi%5D);%0A%09%09%09%09if(jsonObject.approved == true) %7B%0A%09
 %09%09%09%09json
@@ -491,16 +491,23 @@
 sult%5Bi%5D)
+;%0A%09%09%09%09%7D
 %0A%09%09%09%7D%0A%09%09
@@ -654,8 +654,9 @@
 %0A%09%7D);%0A%7D;
+%0A

index shows only approved messages