* Minor changes & cleanup
This commit is contained in:
parent
79e533468a
commit
4cf10ba85c
|
@ -49,6 +49,8 @@ MCIViewFactory.prototype.getPredefinedViewLabel = function(code) {
|
||||||
UT : this.client.user.properties.theme_id,
|
UT : this.client.user.properties.theme_id,
|
||||||
MS : moment(this.client.user.properties.account_created).format(this.client.currentTheme.helpers.getDateFormat()),
|
MS : moment(this.client.user.properties.account_created).format(this.client.currentTheme.helpers.getDateFormat()),
|
||||||
|
|
||||||
|
MA : this.client.user.properties.message_area_name,
|
||||||
|
|
||||||
|
|
||||||
SH : this.client.term.termHeight.toString(),
|
SH : this.client.term.termHeight.toString(),
|
||||||
SW : this.client.term.termWidth.toString(),
|
SW : this.client.term.termWidth.toString(),
|
||||||
|
|
|
@ -73,6 +73,25 @@ function changeCurrentArea(client, areaId, cb) {
|
||||||
client.user.persistProperty('message_area_id', areaId, function persisted(err) {
|
client.user.persistProperty('message_area_id', areaId, function persisted(err) {
|
||||||
callback(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) {
|
function complete(err) {
|
||||||
|
|
|
@ -326,7 +326,7 @@ User.prototype.persistProperty = function(propName, propValue, cb) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
};
|
||||||
|
|
||||||
User.prototype.persistProperties = function(properties, cb) {
|
User.prototype.persistProperties = function(properties, cb) {
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
Binary file not shown.
|
@ -23,10 +23,7 @@ function MessageAreaModule(options) {
|
||||||
|
|
||||||
this.menuMethods = {
|
this.menuMethods = {
|
||||||
changeArea : function(formData, extraArgs) {
|
changeArea : function(formData, extraArgs) {
|
||||||
// :TODO: really, we just need to go to a menu with a list of areas to select from and call a @systemMethod:setMessageArea() call with fallback to here
|
// :TODO: clean this code up
|
||||||
self.client.user.persistProperty('message_area_id', 2, function persisted(err) {
|
|
||||||
|
|
||||||
}); // :TODO: just for testing
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue