Skip to content

Commit

Permalink
Introducing isReply()
Browse files Browse the repository at this point in the history
  • Loading branch information
benwerd committed Jul 11, 2015
1 parent 52a22f3 commit 005542d
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions Idno/Common/Entity.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

namespace Idno\Common {

use Idno\Core\Webmention;
use Idno\Entities\User;

class Entity extends Component implements EntityInterface
Expand Down Expand Up @@ -1257,6 +1258,18 @@ function isPublic()
return false;
}

/**
* Is this entity a reply to another entity?
* @return bool
*/
function isReply()
{
if (!empty($this->inreplyto)) {
return true;
}
return false;
}

/**
* Returns the database collection that this object should be
* saved as part of
Expand Down Expand Up @@ -1590,6 +1603,13 @@ function addWebmentions($source, $target, $source_content, $source_mf2)
}
}
$this->save();

if ($return) {
if ($this->isReply()) {
$webmentions = new Webmention();
$webmentions->pingMentions($this->getDisplayURL());
}
}
}

return $return;
Expand Down

0 comments on commit 005542d

Please sign in to comment.