// Add to the public timeline
if ($notice->is_local == Notice::LOCAL_PUBLIC ||
- ($notice->is_local == Notice::REMOTE_OMB && !common_config('public', 'localonly'))) {
+ ($notice->is_local == Notice::REMOTE && !common_config('public', 'localonly'))) {
$paths[] = array('public', null, null);
}
list($action, $arg1, $arg2) = $path;
$channels = Realtime_channel::getAllChannels($action, $arg1, $arg2);
+ $this->log(LOG_INFO, sprintf(_("%d candidate channels for notice %d"), $notice->id));
foreach ($channels as $channel) {
$profile = Profile::staticGet('id', $channel->user_id);
}
if ($notice->inScope($profile)) {
+ $this->log(LOG_INFO,
+ sprintf(_("Delivering notice %d to channel (%s, %s, %s) for user '%s'"),
+ $notice->id,
+ $channel->action,
+ $channel->arg1,
+ $channel->arg2,
+ ($profile) ? ($profile->nickname) : "<public>"));
$timeline = $this->_pathToChannel(array($channel->channel_key));
$this->_publish($timeline, $json);
}
// root url from page output
$action->elementStart('address');
+
+ if (common_config('singleuser', 'enabled')) {
+ $user = User::singleUser();
+ $url = common_local_url('showstream', array('nickname' => $user->nickname));
+ } else {
+ $url = common_local_url('public');
+ }
+
$action->element('a', array('class' => 'url',
- 'href' => common_local_url('public')),
+ 'href' => $url),
'');
+
$action->elementEnd('address');
$action->showContentBlock();
break;
case 'tag':
$tag = $action->trimmed('tag');
- if (empty($tag)) {
+ if (!empty($tag)) {
$arg1 = $tag;
} else {
$this->log(LOG_NOTICE, "Unexpected 'tag' action without tag argument");