mirror of
https://github.com/thelounge/thelounge.git
synced 2024-06-01 13:22:29 +02:00
18 lines
377 B
JavaScript
18 lines
377 B
JavaScript
var _ = require("lodash");
|
|
|
|
module.exports = User;
|
|
|
|
function User(attr, prefixLookup) {
|
|
_.merge(this, _.extend({
|
|
modes: [],
|
|
nick: ""
|
|
}, 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]) || "";
|
|
}
|