transform and pass through the existing store

pull/1/head
ansuz 9 years ago
parent a08efc568b
commit 061cffe462

@ -8,11 +8,12 @@ var create = module.exports.create = function(filePath, backingStore) {
var file = Fs.createWriteStream(filePath, {flags: 'a+'}); var file = Fs.createWriteStream(filePath, {flags: 'a+'});
return { var originalMessageFunction = backingStore.message;
message: function(channel, msg, callback) {
backingStore.message = function(channel, msg, callback) {
message(file, msg); message(file, msg);
backingStore.message(channel, msg, callback); originalMessageFunction(channel, msg, callback);
},
getMessages: backingStore.getMessages
}; };
return backingStore;
}; };

Loading…
Cancel
Save