Skip to content

Commit 73814f9

Browse files
committed
Supply channel to getTeamDomainForMessage
1 parent 197e50c commit 73814f9

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

lib/BaseSlackHandler.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,12 @@ BaseSlackHandler.prototype.replaceUserIdsWithNames = function(message, token) {
100100
// pass in the response to get user instead.
101101
// Though obviously don't if the response was wrong.
102102
response = res;
103-
return main.getTeamDomainForMessage(res && res.user ? res.user : message);
103+
return main.getTeamDomainForMessage(
104+
{
105+
team_id: (res && res.user ? res.user : message).team_id,
106+
channel: message.channel,
107+
}
108+
);
104109
}).then((team_domain) => {
105110
const user_id = main.getUserId(id, team_domain);
106111
if (response && response.user && response.user.name) {

lib/Main.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,9 @@ Main.prototype.getTeamDomainForMessage = function(message) {
198198
if (message.team_domain) {
199199
return Promise.resolve(message.team_domain);
200200
}
201+
202+
console.log(message);
203+
201204
if (!message.team_id) {
202205
return Promise.reject("Cannot determine team, no id given.");
203206
}

0 commit comments

Comments
 (0)