thelounge/src/models/user.js

18 lines
377 B
JavaScript
Raw Normal View History

2014-09-13 23:29:45 +02:00
var _ = require("lodash");
module.exports = User;
function User(attr, prefixLookup) {
2014-09-13 23:29:45 +02:00
_.merge(this, _.extend({
modes: [],
nick: ""
2014-09-13 23:29:45 +02:00
}, attr));
// irc-framework sets character mode, but lounge works with symbols
this.modes = this.modes.map(mode => prefixLookup[mode]);
// TODO: Remove this
this.name = this.nick;
this.mode = (this.modes && this.modes[0]) || "";
2014-09-13 23:29:45 +02:00
}