diff options
author | Zach Copley <zach@status.net> | 2010-02-16 20:14:33 -0800 |
---|---|---|
committer | Zach Copley <zach@status.net> | 2010-02-16 20:14:33 -0800 |
commit | 5886e9621737c0712b9957edf716b554e04d0ce0 (patch) | |
tree | 1ac7a2a1a858dbed6b26e8d6a862b5152a2c1286 /lib/noticelist.php | |
parent | 2cb243808c2c1540f2690bff5a2d9932fa428923 (diff) | |
parent | e51e96d7248b281e7d0e59f5a9bdcd4e7e651e82 (diff) |
Merge branch 'testing' of gitorious.org:statusnet/mainline into testing
* 'testing' of gitorious.org:statusnet/mainline:
OStatus: override source link with the source domain and link to original message
OStatus: moving parts of profile processing to Activity from feedmunger. Pausing before refactoring DB schema a bit to clean up feed vs person vs group info
Diffstat (limited to 'lib/noticelist.php')
-rw-r--r-- | lib/noticelist.php | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/lib/noticelist.php b/lib/noticelist.php index c05b99024..837cb90fa 100644 --- a/lib/noticelist.php +++ b/lib/noticelist.php @@ -492,30 +492,34 @@ class NoticeListItem extends Widget break; default: - $name = null; + $name = $source_name; $url = null; - $ns = Notice_source::staticGet($this->notice->source); - - if ($ns) { - $name = $ns->name; - $url = $ns->url; - } else { - $app = Oauth_application::staticGet('name', $this->notice->source); - if ($app) { - $name = $app->name; - $url = $app->source_url; + if (Event::handle('StartNoticeSourceLink', array($this->notice, &$name, &$url, &$title))) { + $ns = Notice_source::staticGet($this->notice->source); + + if ($ns) { + $name = $ns->name; + $url = $ns->url; + } else { + $app = Oauth_application::staticGet('name', $this->notice->source); + if ($app) { + $name = $app->name; + $url = $app->source_url; + } } } + Event::handle('EndNoticeSourceLink', array($this->notice, &$name, &$url, &$title)); if (!empty($name) && !empty($url)) { $this->out->elementStart('span', 'device'); $this->out->element('a', array('href' => $url, - 'rel' => 'external'), + 'rel' => 'external', + 'title' => $title), $name); $this->out->elementEnd('span'); } else { - $this->out->element('span', 'device', $source_name); + $this->out->element('span', 'device', $name); } break; } |