setting in_reply_to_profileurl with exception handling

This commit is contained in:
Mikael Nordfeldth 2015-06-12 16:56:25 +02:00
parent 8443b37035
commit 18877f77f0

View File

@ -462,13 +462,11 @@ class QvitterPlugin extends Plugin {
}
// reply-to profile url
$twitter_status['in_reply_to_profileurl'] = null;
if ($notice->reply_to) {
$reply = Notice::getKV(intval($notice->reply_to));
if ($reply) {
$replier_profile = $reply->getProfile();
$twitter_status['in_reply_to_profileurl'] = $replier_profile->profileurl;
}
try {
$reply = $notice->getParent();
$twitter_status['in_reply_to_profileurl'] = $reply->getProfile()->getUrl();
} catch (ServerException $e) {
$twitter_status['in_reply_to_profileurl'] = null;
}