Case insensitive areaTag compare

This commit is contained in:
Bryan Ashby 2016-07-25 14:36:57 -06:00
parent 0a629feeb0
commit d4ce574be3
1 changed files with 2 additions and 2 deletions

View File

@ -507,7 +507,7 @@ function getMessageAreaLastReadId(userId, areaTag, cb) {
'SELECT message_id ' + 'SELECT message_id ' +
'FROM user_message_area_last_read ' + 'FROM user_message_area_last_read ' +
'WHERE user_id = ? AND area_tag = ?;', 'WHERE user_id = ? AND area_tag = ?;',
[ userId, areaTag ], [ userId, areaTag.toLowerCase() ],
function complete(err, row) { function complete(err, row) {
cb(err, row ? row.message_id : 0); cb(err, row ? row.message_id : 0);
} }
@ -587,7 +587,7 @@ function trimMessageAreasScheduledEvent(args, cb) {
ORDER BY message_id DESC ORDER BY message_id DESC
LIMIT -1 OFFSET ${areaInfo.maxMessages} LIMIT -1 OFFSET ${areaInfo.maxMessages}
);`, );`,
[ areaInfo.areaTag], [ areaInfo.areaTag.toLowerCase() ],
err => { err => {
if(err) { if(err) {
Log.error( { areaInfo : areaInfo, err : err, type : 'maxMessages' }, 'Error trimming message area'); Log.error( { areaInfo : areaInfo, err : err, type : 'maxMessages' }, 'Error trimming message area');