From d4ce574be3308f59a92047c0745eee5ace4a781c Mon Sep 17 00:00:00 2001 From: Bryan Ashby Date: Mon, 25 Jul 2016 14:36:57 -0600 Subject: [PATCH] Case insensitive areaTag compare --- core/message_area.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/message_area.js b/core/message_area.js index 1e0a4d1a..f91b7d08 100644 --- a/core/message_area.js +++ b/core/message_area.js @@ -507,7 +507,7 @@ function getMessageAreaLastReadId(userId, areaTag, cb) { 'SELECT message_id ' + 'FROM user_message_area_last_read ' + 'WHERE user_id = ? AND area_tag = ?;', - [ userId, areaTag ], + [ userId, areaTag.toLowerCase() ], function complete(err, row) { cb(err, row ? row.message_id : 0); } @@ -587,7 +587,7 @@ function trimMessageAreasScheduledEvent(args, cb) { ORDER BY message_id DESC LIMIT -1 OFFSET ${areaInfo.maxMessages} );`, - [ areaInfo.areaTag], + [ areaInfo.areaTag.toLowerCase() ], err => { if(err) { Log.error( { areaInfo : areaInfo, err : err, type : 'maxMessages' }, 'Error trimming message area');