From 3f9e6e7d86897a4d8331de8e6996f3ee01478219 Mon Sep 17 00:00:00 2001 From: psychobunny Date: Mon, 28 Jul 2014 14:23:25 -0400 Subject: [PATCH] closes #1901 --- src/messaging.js | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/src/messaging.js b/src/messaging.js index 7557399974..599f6df308 100644 --- a/src/messaging.js +++ b/src/messaging.js @@ -80,18 +80,7 @@ var db = require('./database'), return callback(err); } - // Truncate recent chats list back down to 10 (should use LTRIM, see nodebb/nodebb#1901) - db.getListRange('messages:recent:' + fromuid, 0, -1, function(err, list) { - if (err) { - return callback(err); - } - - if (list.length > 10) { - db.listRemoveLast('messages:recent:' + fromuid, callback); - } else { - callback(); - } - }); + db.listTrim('messages:recent:' + fromuid, 0, 9, callback); }); }