Skip to content

Commit 1909a76

Browse files
committed
tested the alerts system and it works
1 parent 31dd9ae commit 1909a76

File tree

5 files changed

+38
-1
lines changed

5 files changed

+38
-1
lines changed

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ Hubot-phabs Changelog
55
- make possible to specify an optional limit to search commands
66
with `.ph search 10 <terms>` or `.ph <project> 10 <terms>`
77
- fix duplication of feeds array elements (no impact, just annoying)
8+
- added a system of alerts: users can be notified in private of tasks
9+
that he owns or is subscribed to. `.phab me set alerts`
10+
- `.phab me unset alerts` to cancel the announcements
811

912
### 2.4.0 - 2017-04-07
1013
- make possible to get info on project sub-projects

README.md

+19
Original file line numberDiff line numberDiff line change
@@ -462,6 +462,25 @@ Note that the tasks from a subprojects are also announced in the feed for the pa
462462

463463
The feed has an optional way to limit the IP of the sender, by setting the HUBOT_AUTHORIZED_IP_REGEXP env variable. If this variable is not set, there is not access control. It's a limited soft protection, if you really need a heavy secure protection, do something on your network for it.
464464

465+
Since 2.4.1, users can also set private alerts on tasks they own or are subscribed to.
466+
467+
.phab me set alerts
468+
will send a private message for each task the caller owns or is subscribed to
469+
(note: it only works on tasks for now)
470+
permission: phuser
471+
472+
.phab <user> set alerts
473+
same as with 'me' but with arbitrary user name, to enable their subscription to alerts
474+
permission: phadmin
475+
476+
.phab me unset alerts
477+
will disable alerts
478+
permission: phuser
479+
480+
.phab <user> unset alerts
481+
same as with 'me' but with arbitrary user name, to disable their subscription to alerts
482+
permission: phadmin
483+
465484

466485
### Hear feature
467486

index.coffee

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ path = require 'path'
33
phabs_available_features = [
44
'events',
55
'api',
6+
'feeds',
67
'commands',
78
'templates',
89
'admin',
9-
'feeds',
1010
'hear'
1111
]
1212

scripts/phabs_feeds.coffee

+2
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,11 @@ module.exports = (robot) ->
7575
msg.finish()
7676

7777
robot.router.post "/#{robot.name}/phabs/feeds", (req, res) ->
78+
console.log req.body
7879
if req.body.storyID?
7980
phab.getFeed(req.body)
8081
.then (announce) ->
82+
console.log announce
8183
for room in announce.rooms
8284
robot.messageRoom room, announce.message
8385
for user in announce.users

test/samples/payload1-mose

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"storyID": "7373",
3+
"storyType": "PhabricatorApplicationTransactionFeedStory",
4+
"storyData": {
5+
"objectPHID": "PHID-TASK-bulf4rmnblr3ajtqugtj",
6+
"transactionPHIDs": {
7+
"PHID-XACT-PSTE-zmss7ubkaq5pzor": "PHID-XACT-PSTE-zmss7ubkaq5pzor"
8+
}
9+
},
10+
"storyAuthorPHID": "PHID-USER-qzoqvowxnb5k5screlji",
11+
"storyText": "ash created P6 new test paste.",
12+
"epoch": "1469408232"
13+
}

0 commit comments

Comments
 (0)