From dc1ceca86ea5310bc04df21f94db68015d3b9d59 Mon Sep 17 00:00:00 2001 From: Mikael Nordfeldth Date: Wed, 2 Mar 2016 13:29:54 +0100 Subject: [PATCH] Some more Microformats2 data for notices and rendering --- lib/noticelistitem.php | 10 ++++++++-- lib/util.php | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/noticelistitem.php b/lib/noticelistitem.php index ad5962d751..a0dcf6f30c 100644 --- a/lib/noticelistitem.php +++ b/lib/noticelistitem.php @@ -301,9 +301,15 @@ class NoticeListItem extends Widget foreach ($attentions as $attn) { $class = $attn->isGroup() ? 'group' : 'account'; - $this->pa[] = array('href' => $attn->profileurl, + $profileurl = $attn->getUri(); + if (common_valid_http_url($profileurl)) { + $class .= ' u-uid'; + } else { + $profileurl = $attn->getUrl(); + } + $this->pa[] = array('href' => $profileurl, 'title' => $attn->getNickname(), - 'class' => "addressee {$class}", + 'class' => "addressee {$class} p-name u-url", 'text' => $attn->getStreamName()); } diff --git a/lib/util.php b/lib/util.php index 5aeda6d750..05e3e732bd 100644 --- a/lib/util.php +++ b/lib/util.php @@ -692,7 +692,7 @@ function common_linkify_mention(array $mention) $xs = new XMLStringer(false); $attrs = array('href' => $mention['url'], - 'class' => 'h-card '.$mention['type']); + 'class' => 'h-card u-url p-nickname '.$mention['type']); if (!empty($mention['title'])) { $attrs['title'] = $mention['title']; -- 2.39.5