diff --git a/Phabricator/plugin.py b/Phabricator/plugin.py --- a/Phabricator/plugin.py +++ b/Phabricator/plugin.py @@ -107,9 +107,14 @@ ) return self.conduit_for_host_token(host, token) - def get_object_by_phid(self, recipient, phid, skip_cache=False): + def get_object_by_phid(self, recipient, phid, + skip_cache=False, object_fragment=None): objs = self.get_objects_by_phid(recipient, [phid], skip_cache) - return objs.get(phid) + obj = objs.get(phid) + if obj and object_fragment is not None: + url = obj['uri'] + obj['uri'] = '%s%s' % (url, object_fragment) + return obj def get_objects_by_phid(self, recipient, phids, skip_cache=False): objects = {} @@ -220,16 +225,16 @@ ^ # start of line |(?".format( id=ircutils.bold('P%s' % paste['id']), title=paste['fields']['title'], @@ -318,8 +329,9 @@ url=full_paste['uri'], ) - def task_formatter(self, recipient, task): - full_task = self.get_object_by_phid(recipient, task['phid'], True) + def task_formatter(self, recipient, task, object_fragment=None): + full_task = self.get_object_by_phid(recipient, task['phid'], True, + object_fragment=object_fragment) details = [] details.append( 'submitter: %s' % self.get_user_by_phid(