+
+ foreach ($notice->getAttentionProfiles() as $target) {
+ common_debug("OSTATUS [{$this->notice->getID()}]: Attention target profile {$target->getNickname()} ({$target->getID()})");
+ if ($target->isGroup()) {
+ common_debug("OSTATUS [{$this->notice->getID()}]: {$target->getID()} is a group");
+ $oprofile = Ostatus_profile::getKV('group_id', $target->getGroup()->getID());
+ if (!$oprofile instanceof Ostatus_profile) {
+ // we don't save profiles like this yet, but in the future
+ $oprofile = Ostatus_profile::getKV('profile_id', $target->getID());
+ }
+ if ($oprofile instanceof Ostatus_profile) {
+ // remote group
+ if ($notice->isLocal()) {
+ common_debug("OSTATUS [{$this->notice->getID()}]: notice is local and remote group with profile ID {$target->getID()} gets a ping");
+ $this->pingReply($oprofile);
+ }
+ } else {
+ common_debug("OSTATUS [{$this->notice->getID()}]: local group with profile id {$target->getID()} gets pushed out");
+ // local group
+ $this->pushGroup($target->getGroup());
+ }
+ } elseif ($notice->isLocal()) {
+ // Notices generated on other sites will have already
+ // pinged their reply-targets, so only do these things
+ // if the target is not a group and the notice is locally generated
+
+ $oprofile = Ostatus_profile::getKV('profile_id', $target->getID());
+ if ($oprofile instanceof Ostatus_profile) {
+ common_debug("OSTATUS [{$this->notice->getID()}]: Notice is local and {$target->getID()} is remote profile, getting pingReply");
+ $this->pingReply($oprofile);
+ }