Browse Source

Merge branch 'auth' of git.knacki.info:isundil/knackigate-slack into auth

isundil 8 years ago
parent
commit
4faadb60c6
1 changed files with 3 additions and 2 deletions
  1. 3 2
      srv/src/slack.js

+ 3 - 2
srv/src/slack.js

@@ -598,7 +598,7 @@ Slack.prototype.editMsg = function(channel, msgId, text) {
 /**
  * @param {SlackChan|SlackGroup|SlackIms} target
 **/
-Slack.prototype.fetchHistory = function(target, cb) {
+Slack.prototype.fetchHistory = function(target, cb, count) {
     var _this = this
         ,baseUrl = ""
         ,targetId = target.remoteId;
@@ -613,9 +613,10 @@ Slack.prototype.fetchHistory = function(target, cb) {
     httpsRequest(baseUrl
         +"?token="+this.token
         +"&channel=" +targetId
-        +"&count=" +HISTORY_LENGTH,
+        +"&count=" +(count || 100),
     (status, resp) => {
         var history = [];
+        console.log(count || 100);
         if (status === 200 && resp && resp.ok) {
             var histo = this.history[target.id];
             if (!histo)