mirror of
https://github.com/thelounge/thelounge.git
synced 2024-06-27 17:50:24 +02:00
3711aefc2d
Fix memory and reference shuffling when creating models
20 lines
385 B
JavaScript
20 lines
385 B
JavaScript
"use strict";
|
|
|
|
var _ = require("lodash");
|
|
|
|
module.exports = User;
|
|
|
|
function User(attr, prefixLookup) {
|
|
_.defaults(this, attr, {
|
|
modes: [],
|
|
nick: ""
|
|
});
|
|
|
|
// 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]) || "";
|
|
}
|