File tree 2 files changed +4
-18
lines changed
src/lib/messaging_handler
2 files changed +4
-18
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " hubot-stackstorm-auth" ,
3
3
"description" : " A hubot plugin for integrating with StackStorm event-driven infrastructure automation platform with role based auth." ,
4
- "version" : " 0.1.2 " ,
4
+ "version" : " 1. 0.1" ,
5
5
"author" :
" Silver Blueprints, LLC. <[email protected] >" ,
6
6
"license" : " Apache-2.0" ,
7
7
"keywords" : [
27
27
"rsvp" : " 3.0.14" ,
28
28
"st2client" : " ^0.4.3" ,
29
29
"truncate" : " ^1.0.4" ,
30
- "node-uuid" : " ~1.4.0" ,
31
- "mongodb" : " ^2.0.52" ,
32
- "mongodb-url" : " ^1.0.3"
30
+ "node-uuid" : " ~1.4.0"
33
31
},
34
32
"peerDependencies" : {
35
33
"hubot" : " 2.x"
Original file line number Diff line number Diff line change @@ -9,19 +9,6 @@ var DefaultMessagingHandler = require('./default');
9
9
function SlackMessagingHandler ( robot ) {
10
10
var self = this ;
11
11
DefaultMessagingHandler . call ( this , robot ) ;
12
-
13
- var sendMessageRaw = function ( message ) {
14
- /*jshint validthis:true */
15
- message [ 'channel' ] = this . id ;
16
- message [ 'parse' ] = 'none' ;
17
- this . _client . _send ( message ) ;
18
- } ;
19
-
20
- if ( robot . adapter && robot . adapter . constructor && robot . adapter . constructor . name === 'SlackBot' ) {
21
- for ( var channel in robot . adapter . client . channels ) {
22
- robot . adapter . client . channels [ channel ] . sendMessage = sendMessageRaw . bind ( robot . adapter . client . channels [ channel ] ) ;
23
- }
24
- }
25
12
}
26
13
27
14
util . inherits ( SlackMessagingHandler , DefaultMessagingHandler ) ;
@@ -80,9 +67,10 @@ SlackMessagingHandler.prototype.postData = function(data) {
80
67
} ;
81
68
82
69
SlackMessagingHandler . prototype . normalizeAddressee = function ( msg ) {
70
+ var room_name = robot . adapter . client . rtm . dataStore . getChannelById ( msg . message . room ) . name
83
71
return {
84
72
name : msg . message . user . name ,
85
- room : msg . message . room
73
+ room : room_name
86
74
} ;
87
75
} ;
88
76
You can’t perform that action at this time.
0 commit comments