Skip to content
This repository was archived by the owner on Jun 8, 2023. It is now read-only.

Commit a140d25

Browse files
author
Kim Neunert
committed
fixed bitbucket-activity.coffee to recent api datastructure
1 parent 30161cc commit a140d25

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

src/scripts/bitbucket-activity.coffee

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,13 @@ module.exports = (robot) ->
3232
msg.send "https://bitbucket.com/#{repo}"
3333
send = 5
3434
for c in data.events
35-
if send
36-
d = new Date(Date.parse(c.created_on)).toFormat("MM/DD/YY HH24:MI")
37-
stamp = "#{d}"
38-
# events aren't always related to a user, do only conditionally add in the username
39-
stamp = stamp + " -> #{c.user.username}" if c.user
40-
41-
msg.send "[#{stamp}] #{c.description}"
42-
send -= 1
35+
if send and c.description != null
36+
for commit in c.description.commits
37+
d = new Date(Date.parse(c.created_on)).toFormat("MM/DD/YY HH24:MI")
38+
stamp = "#{d}"
39+
# events aren't always related to a user, do only conditionally add in the username
40+
stamp = stamp + " -> #{c.user.username}" if c.user
41+
# msg.send "#{JSON.stringify(c)}"
42+
msg.send "[#{stamp}] #{commit.description}"
43+
send -= 1
44+

0 commit comments

Comments
 (0)