2014-06-26 23:05:47 +00:00
|
|
|
var _ = require("lodash");
|
|
|
|
|
|
|
|
module.exports = Chan;
|
|
|
|
|
|
|
|
Chan.Type = {
|
|
|
|
CHANNEL: "channel",
|
|
|
|
LOBBY: "lobby",
|
|
|
|
QUERY: "query"
|
|
|
|
};
|
|
|
|
|
2014-06-29 01:07:38 +00:00
|
|
|
var id = 0;
|
|
|
|
|
2014-06-26 23:05:47 +00:00
|
|
|
function Chan(attr) {
|
|
|
|
_.merge(this, _.extend({
|
2014-06-29 01:07:38 +00:00
|
|
|
id: id++,
|
2014-06-26 23:05:47 +00:00
|
|
|
type: Chan.Type.CHANNEL,
|
|
|
|
name: "",
|
|
|
|
messages: [],
|
|
|
|
users: []
|
|
|
|
}));
|
|
|
|
}
|