$groups = $this->user->getGroups();
- while ($groups->fetch()) {
+ while ($groups instanceof User_group && $groups->fetch()) {
$value = 'group:'.$groups->id;
if (($this->to instanceof User_group) && $this->to->id == $groups->id) {
$default = $value;
$toArg = $action->trimmed('notice_to');
$private = $action->boolean('notice_private');
+ if (empty($toArg)) {
+ return;
+ }
+
list($prefix, $value) = explode(':', $toArg);
switch ($prefix) {
case 'group':
}
break;
case 'profile':
- $profile = Profile::staticGet('id', $value);
- $options['replies'] = $profile->getUri();
+ $profile = Profile::getKV('id', $value);
+ $options['replies'] = array($profile->getUri());
if ($private) {
$options['scope'] = Notice::ADDRESSEE_SCOPE;
}