|
|
@@ -109,7 +109,8 @@ Slack.prototype.connect = function(cb) {
|
|
|
team: body["team"],
|
|
|
users: body["users"],
|
|
|
bots: body["bots"],
|
|
|
- self: body["self"]
|
|
|
+ self: body["self"],
|
|
|
+ channels: body["channels"]
|
|
|
}, Date.now());
|
|
|
_this.connectRtm(body.url);
|
|
|
}
|
|
|
@@ -639,6 +640,7 @@ Slack.prototype.sendMsg = function(channel, text, attachments) {
|
|
|
+"?token=" +this.token
|
|
|
+"&channel=" +channel.remoteId
|
|
|
+"&text=" +text.join("\n")
|
|
|
+ +"&link_names=true"
|
|
|
+ (attachments ? ("&attachments=" +encodeURIComponent(JSON.stringify(attachments))) : "")
|
|
|
+"&as_user=true");
|
|
|
} else {
|
|
|
@@ -753,8 +755,8 @@ Slack.prototype.fetchHistory = function(target, cb, count, firstMsgId) {
|
|
|
if (!target.pins || target.pins.length !== resp["pin_count"]) {
|
|
|
if (!resp["pin_count"]) {
|
|
|
target.pins = [];
|
|
|
- target.v = Math.max(target.v, Date.now());
|
|
|
- _this.data.staticV = Math.max(_this.data.staticV, target.v);
|
|
|
+ target.version = Math.max(target.version, Date.now());
|
|
|
+ _this.data.staticV = Math.max(_this.data.staticV, target.version);
|
|
|
} else {
|
|
|
_this.fetchPinned(target);
|
|
|
}
|