Shuo/lib/models/chan.js

26 lines
354 B
JavaScript
Raw Normal View History

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: []
2014-06-30 01:20:54 +00:00
}, attr));
2014-06-26 23:05:47 +00:00
}
2014-06-29 19:41:02 +00:00
Chan.prototype.sortUsers = function() {
// ..
};