2016-10-09 19:14:02 +00:00
|
|
|
"use strict";
|
|
|
|
|
2014-09-13 21:29:45 +00:00
|
|
|
var _ = require("lodash");
|
|
|
|
|
|
|
|
module.exports = User;
|
|
|
|
|
2016-09-24 16:34:35 +00:00
|
|
|
function User(attr, prefixLookup) {
|
2016-10-02 07:37:37 +00:00
|
|
|
_.defaults(this, attr, {
|
2016-09-24 16:34:35 +00:00
|
|
|
modes: [],
|
|
|
|
nick: ""
|
2016-10-02 07:37:37 +00:00
|
|
|
});
|
2016-09-24 16:34:35 +00:00
|
|
|
|
|
|
|
// 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 21:29:45 +00:00
|
|
|
}
|