- if (!empty($this->notice->reply_to)) {
- $replyTo = Notice::getKV('id', $this->notice->reply_to);
- if (!empty($replyTo)) {
- foreach($replyTo->getReplies() as $profile_id) {
- $oprofile = Ostatus_profile::getKV('profile_id', $profile_id);
- if ($oprofile) {
- $this->pingReply($oprofile);
- }
+ if ($notice->isLocal()) {
+ try {
+ $parent = $this->notice->getParent();
+ foreach($parent->getAttentionProfiles() as $related) {
+ if ($related->isGroup()) {
+ // don't ping groups in parent notices since we might not be a member of them,
+ // though it could be useful if we study this and use it correctly
+ continue;
+ }
+ common_debug("OSTATUS [{$this->notice->getID()}]: parent notice {$parent->getID()} has related profile id=={$related->getID()}");
+ // FIXME: don't ping twice in case someone is in both notice attention spans!
+ $oprofile = Ostatus_profile::getKV('profile_id', $related->getID());
+ if ($oprofile instanceof Ostatus_profile) {
+ $this->pingReply($oprofile);