forked from GNUsocial/gnu-social
getConversationUrl introduced for linking to conversations
This commit is contained in:
@@ -183,17 +183,9 @@ class UserEmailSummaryHandler extends QueueHandler
|
||||
'title' => $dt),
|
||||
common_date_string($notice->created));
|
||||
$out->elementEnd('a');
|
||||
if ($notice->hasConversation()) {
|
||||
$conv = Conversation::getKV('id', $notice->conversation);
|
||||
$convurl = $conv->uri;
|
||||
if (!empty($convurl)) {
|
||||
$out->text(' ');
|
||||
$out->element('a',
|
||||
array('href' => $convurl.'#notice-'.$notice->id),
|
||||
// TRANS: Link text for link to conversation view.
|
||||
_m('in context'));
|
||||
}
|
||||
}
|
||||
$out->element('a', array('href' => $notice->getConversationUrl()),
|
||||
// TRANS: Link text for link to conversation view.
|
||||
_m('in context'));
|
||||
$out->elementEnd('div');
|
||||
$out->elementEnd('td');
|
||||
$out->elementEnd('tr');
|
||||
|
@@ -321,7 +321,7 @@ class RealtimePlugin extends Plugin
|
||||
$arr['url'] = $notice->getUrl();
|
||||
$arr['html'] = htmlspecialchars($notice->rendered);
|
||||
$arr['source'] = htmlspecialchars($arr['source']);
|
||||
$arr['conversation_url'] = $this->getConversationUrl($notice);
|
||||
$arr['conversation_url'] = $notice->getConversationUrl();
|
||||
|
||||
$profile = $notice->getProfile();
|
||||
$arr['user']['profile_url'] = $profile->profileurl;
|
||||
@@ -336,7 +336,7 @@ class RealtimePlugin extends Plugin
|
||||
$arr['retweeted_status']['source'] = htmlspecialchars($original->source);
|
||||
$originalProfile = $original->getProfile();
|
||||
$arr['retweeted_status']['user']['profile_url'] = $originalProfile->profileurl;
|
||||
$arr['retweeted_status']['conversation_url'] = $this->getConversationUrl($original);
|
||||
$arr['retweeted_status']['conversation_url'] = $original->getConversationUrl();
|
||||
}
|
||||
unset($original);
|
||||
}
|
||||
@@ -364,33 +364,6 @@ class RealtimePlugin extends Plugin
|
||||
return $tags;
|
||||
}
|
||||
|
||||
function getConversationUrl($notice)
|
||||
{
|
||||
$convurl = null;
|
||||
|
||||
if ($notice->hasConversation()) {
|
||||
$conv = Conversation::getKV(
|
||||
'id',
|
||||
$notice->conversation
|
||||
);
|
||||
$convurl = $conv->uri;
|
||||
|
||||
if(empty($convurl)) {
|
||||
$msg = sprintf( "Could not find Conversation ID %d to make 'in context'"
|
||||
. "link for Notice ID %d.",
|
||||
$notice->conversation,
|
||||
$notice->id
|
||||
);
|
||||
|
||||
common_log(LOG_WARNING, $msg);
|
||||
} else {
|
||||
$convurl .= '#notice-' . $notice->id;
|
||||
}
|
||||
}
|
||||
|
||||
return $convurl;
|
||||
}
|
||||
|
||||
function _getScripts()
|
||||
{
|
||||
$urlpath = self::staticPath(str_replace('Plugin','',__CLASS__),
|
||||
|
Reference in New Issue
Block a user