File tree 1 file changed +11
-3
lines changed
1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,11 @@ function wlog () {
33
33
}
34
34
35
35
var sendHipChatMessage = function ( msg ) {
36
+ if ( msg . user_id === 'USLACKBOT' ) {
37
+ wlog ( "skipping message from myself " + msg . user_name + ": " + msg . text ) ;
38
+ return ;
39
+ }
40
+
36
41
wlog ( "relaying to hipchat " + msg . user_name + ": " + msg . text ) ;
37
42
hipbot . postMessage ( {
38
43
room : config . hipchat . room ,
@@ -81,7 +86,7 @@ var sendSlackMessage = function (msg) {
81
86
} ;
82
87
83
88
var hipchatMessages = [ ] ;
84
- var pollHipChat = function ( ) {
89
+ var pollHipChat = function ( dont_send ) {
85
90
wlog ( "checking for hipchat" ) ;
86
91
87
92
getHipChatMessages ( function ( err , data ) {
@@ -101,13 +106,16 @@ var pollHipChat = function(){
101
106
return true ;
102
107
} ) ;
103
108
104
- newMessages . forEach ( sendSlackMessage ) ;
105
109
hipchatMessages = hipchatMessages . concat ( newMessages ) ;
106
110
wlog ( "found " + newMessages . length + " new messags" ) ;
107
111
112
+ if ( ! dont_send ) {
113
+ newMessages . forEach ( sendSlackMessage ) ;
114
+ }
115
+
108
116
setTimeout ( pollHipChat , 5000 ) ;
109
117
} ) ;
110
118
111
119
} ;
112
120
113
- pollHipChat ( ) ;
121
+ pollHipChat ( true ) ;
You can’t perform that action at this time.
0 commit comments