- if ($this->isMyActivity($activity)) {
- $this->log(LOG_INFO, "Checking {$activity->id} as a valid Salmon slap.");
-
- if ($target instanceof User_group) {
- $uri = $target->getUri();
- if (!array_key_exists($uri, $activity->context->attention)) {
- // @todo FIXME: please document (i18n).
- // TRANS: Client exception thrown when ...
- throw new ClientException(_('Object not posted to this group.'));
- }
- } else if ($target instanceof User) {
- $uri = $target->uri;
- $original = null;
- if (!empty($activity->context->replyToID)) {
- $original = Notice::getKV('uri',
- $activity->context->replyToID);
- }
- if (!array_key_exists($uri, $activity->context->attention) &&
- (empty($original) ||
- $original->profile_id != $target->id)) {
- // @todo FIXME: Please document (i18n).
- // TRANS: Client exception when ...
- throw new ClientException(_('Object not posted to this user.'));
- }
- } else {
- // TRANS: Server exception thrown when a micro app plugin uses a target that cannot be handled.
- throw new ServerException(_('Do not know how to handle this kind of target.'));
- }