mirror of
https://github.com/NuSkooler/enigma-bbs.git
synced 2025-07-23 19:20:41 +02:00
* Last callers module WIP
This commit is contained in:
parent
35a99b7e3e
commit
542327460b
7 changed files with 156 additions and 40 deletions
12
core/user.js
12
core/user.js
|
@ -296,6 +296,18 @@ User.prototype.persist = function(useTransaction, cb) {
|
|||
);
|
||||
};
|
||||
|
||||
User.prototype.persistProperty = function(propName, propValue, cb) {
|
||||
// update live props
|
||||
this.properties[propName] = propValue;
|
||||
|
||||
userDb.run(
|
||||
'REPLACE INTO user_property (user_id, prop_name, prop_value) ' +
|
||||
'VALUES (?, ?, ?);', [ this.userId, propName, propValue ], function ran(err) {
|
||||
cb(err);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
User.prototype.persistProperties = function(cb) {
|
||||
assert(this.userId > 0);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue