* Minor changes & cleanup

This commit is contained in:
Bryan Ashby 2015-08-19 16:05:35 -06:00
parent 79e533468a
commit 4cf10ba85c
5 changed files with 23 additions and 5 deletions

View file

@ -73,6 +73,25 @@ function changeCurrentArea(client, areaId, cb) {
client.user.persistProperty('message_area_id', areaId, function persisted(err) {
callback(err);
});
},
function cacheAreaName(callback) {
msgDb.get(
'SELECT area_name ' +
'FROM message_area ' +
'WHERE area_id=? ' +
'LIMIT 1;',
[ areaId ],
function got(err, row) {
// note: failures here are non-fatal
if(err) {
callback(null);
} else {
client.user.persistProperty('message_area_name', row.area_name, function persisted(err) {
callback(null);
});
}
}
);
}
],
function complete(err) {