Closed sigv closed 12 years ago
This has been implemented in a pretty basic way in dyn_users
branch. The current implementation on the branch is as follows:
var handler = function (act) {
// Before the callback, the file is reloaded from disk.
irc.readUsers(function (users) {
if (typeof users['foo'] === 'undefined')
users['foo'] = {};
users['foo'].bar = 10;
});
// After the callback, the changes are saved to disk.
}
I finalized this one and merged it into master. I believe the branch can be deleted.
Currently when the
irc.users
object is modified when a new message is received (so that!seen
reflects to the correct message) the changes are only kept in the memory and not saved to the users.json file. The "last seen" should be persistent over sessions. The users.json file should also be loaded when it is used so that if the file is changed, the changes to it appear immediately.