return true;
}
- function onAutoload($cls)
- {
- $dir = dirname(__FILE__);
-
- switch ($cls)
- {
- case 'KeepalivechannelAction':
- case 'ClosechannelAction':
- include_once $dir . '/' . strtolower(mb_substr($cls, 0, -6)) . '.php';
- return false;
- case 'Realtime_channel':
- include_once $dir.'/'.$cls.'.php';
- return false;
- default:
- return true;
- }
- }
-
/**
* Hook for RouterInitialized event.
*
return true;
}
- $user = User::staticGet('id', $notice->profile_id);
+ $user = User::getKV('id', $notice->profile_id);
if (!empty($user)) {
$paths[] = array('showstream', $user->nickname, null);
$ni = $notice->whoGets();
foreach (array_keys($ni) as $user_id) {
- $user = User::staticGet('id', $user_id);
+ $user = User::getKV('id', $user_id);
$paths[] = array('all', $user->nickname, null);
}
if ($reply->find()) {
while ($reply->fetch()) {
- $user = User::staticGet('id', $reply->profile_id);
+ $user = User::getKV('id', $reply->profile_id);
if (!empty($user)) {
$paths[] = array('replies', $user->nickname, null);
}
if ($gi->find()) {
while ($gi->fetch()) {
- $ug = User_group::staticGet('id', $gi->group_id);
+ $ug = User_group::getKV('id', $gi->group_id);
$paths[] = array('showgroup', $ug->nickname, null);
}
}
list($action, $arg1, $arg2) = $path;
$channels = Realtime_channel::getAllChannels($action, $arg1, $arg2);
+ $this->log(LOG_INFO, sprintf(_("%d candidate channels for notice %d"),
+ count($channels),
+ $notice->id));
foreach ($channels as $channel) {
if (is_null($channel->user_id)) {
$profile = null;
} else {
- $profile = Profile::staticGet('id', $channel->user_id);
+ $profile = Profile::getKV('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);
}
// Add needed repeat data
if (!empty($notice->repeat_of)) {
- $original = Notice::staticGet('id', $notice->repeat_of);
+ $original = Notice::getKV('id', $notice->repeat_of);
if (!empty($original)) {
$arr['retweeted_status']['url'] = $original->bestUrl();
$arr['retweeted_status']['html'] = htmlspecialchars($original->rendered);
$convurl = null;
if ($notice->hasConversation()) {
- $conv = Conversation::staticGet(
+ $conv = Conversation::getKV(
'id',
$notice->conversation
);