I am trying to integrate phabricator with jabber chat. I have created a bot that sends messages to the commit author in jabber chat for every new feed query. My requirement is that how do I get the original author of a commit if the feed story is a concern,audit or commnet. I want to notify the author of the commit of any concerns raised with his commit. Do I need to analyse the story to get this informaiton? How do I go about doing this?
Thanks in advance
The story object should have a data element that will include information about the Author and committer. Like so:
If not, it should have an objectPHID:
You can query from there using conduit calls.
I queried the feed.query. and extracted the
authorPHID
andobjectPHID
if available. With theobjectPHID
I querieddiffernetial.query
conduit method to find out thereviewers
andccs
. Theccs
is an array of users that have to receive a cc of the message. Then i used theuser.query
conduit method to extract usernames and mapped them to jabber usernames and sent the messages.The best way to understand and test this is the following http://phabricator.yourhost.com/conduit/method/feed.query/
click [call method]
This will return a list of changes that you will be interested in: "objectPHID": "PHID-DREV-xxxxxxx",
...
Now http://phabricator.yourhost.com/conduit/method/differential.query/
set phids => ["PHID-DREV-xxxxxxx"]
...
This will return "authorPHID": "PHID-USER-xxxxx", and "reviewers": ["xxxx","xxxx","xxxx"]
...
I also suggest reviewing /src/infrastructure/daemon/bot/handler/PhabricatorBotFeedNotificationHandler.php
Now the code