summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvan Prodromou <evan@controlyourself.ca>2009-04-29 12:12:28 -0400
committerEvan Prodromou <evan@controlyourself.ca>2009-04-29 12:12:28 -0400
commite78342c4844fa935d7e455d669cb2617c6362a4b (patch)
tree94a5cb2ffa0a285afe3bdeaa6f12ad491dfb97d1
parenta4d959b8a2254d173bdf45f418f6add9f6f62cda (diff)
parente85cddba45c2ce02d135f00acdcfa37cb9168130 (diff)
Merge branch '0.7.x' of git@gitorious.org:laconica/dev into 0.7.x
-rw-r--r--actions/twitapistatuses.php38
-rw-r--r--lib/router.php4
2 files changed, 23 insertions, 19 deletions
diff --git a/actions/twitapistatuses.php b/actions/twitapistatuses.php
index 323c4f1f8..3abeba367 100644
--- a/actions/twitapistatuses.php
+++ b/actions/twitapistatuses.php
@@ -144,10 +144,10 @@ class TwitapistatusesAction extends TwitterapiAction
break;
case 'atom':
if (isset($apidata['api_arg'])) {
- $selfuri = $selfuri = common_root_url() .
+ $selfuri = common_root_url() .
'api/statuses/friends_timeline/' . $apidata['api_arg'] . '.atom';
} else {
- $selfuri = $selfuri = common_root_url() .
+ $selfuri = common_root_url() .
'api/statuses/friends_timeline.atom';
}
$this->show_atom_timeline($notice, $title, $id, $link, $subtitle, null, $selfuri);
@@ -231,10 +231,10 @@ class TwitapistatusesAction extends TwitterapiAction
break;
case 'atom':
if (isset($apidata['api_arg'])) {
- $selfuri = $selfuri = common_root_url() .
+ $selfuri = common_root_url() .
'api/statuses/user_timeline/' . $apidata['api_arg'] . '.atom';
} else {
- $selfuri = $selfuri = common_root_url() .
+ $selfuri = common_root_url() .
'api/statuses/user_timeline.atom';
}
$this->show_atom_timeline($notice, $title, $id, $link, $subtitle, $suplink, $selfuri);
@@ -344,7 +344,7 @@ class TwitapistatusesAction extends TwitterapiAction
$this->show($args, $apidata);
}
- function replies($args, $apidata)
+ function mentions($args, $apidata)
{
parent::handle($args);
@@ -360,11 +360,13 @@ class TwitapistatusesAction extends TwitterapiAction
$profile = $user->getProfile();
$sitename = common_config('site', 'name');
- $title = sprintf(_('%1$s / Updates replying to %2$s'), $sitename, $user->nickname);
+ $title = sprintf(_('%1$s / Updates mentioning %2$s'),
+ $sitename, $user->nickname);
$taguribase = common_config('integration', 'taguri');
- $id = "tag:$taguribase:Replies:".$user->id;
+ $id = "tag:$taguribase:Mentions:".$user->id;
$link = common_local_url('replies', array('nickname' => $user->nickname));
- $subtitle = sprintf(_('%1$s updates that reply to updates from %2$s / %3$s.'), $sitename, $user->nickname, $profile->getBestName());
+ $subtitle = sprintf(_('%1$s updates that reply to updates from %2$s / %3$s.'),
+ $sitename, $user->nickname, $profile->getBestName());
if (!$page) {
$page = 1;
@@ -385,7 +387,8 @@ class TwitapistatusesAction extends TwitterapiAction
$since = strtotime($this->arg('since'));
- $notice = $user->getReplies((($page-1)*20), $count, $since_id, $before_id, $since);
+ $notice = $user->getReplies((($page-1)*20),
+ $count, $since_id, $before_id, $since);
$notices = array();
while ($notice->fetch()) {
@@ -400,14 +403,10 @@ class TwitapistatusesAction extends TwitterapiAction
$this->show_rss_timeline($notices, $title, $link, $subtitle);
break;
case 'atom':
- if (isset($apidata['api_arg'])) {
- $selfuri = $selfuri = common_root_url() .
- 'api/statuses/replies/' . $apidata['api_arg'] . '.atom';
- } else {
- $selfuri = $selfuri = common_root_url() .
- 'api/statuses/replies.atom';
- }
- $this->show_atom_timeline($notices, $title, $id, $link, $subtitle, null, $selfuri);
+ $selfuri = common_root_url() .
+ ltrim($_SERVER['QUERY_STRING'], 'p=');
+ $this->show_atom_timeline($notices, $title, $id, $link, $subtitle,
+ null, $selfuri);
break;
case 'json':
$this->show_json_timeline($notices);
@@ -418,6 +417,11 @@ class TwitapistatusesAction extends TwitterapiAction
}
+ function replies($args, $apidata)
+ {
+ call_user_func(array($this, 'mentions'), $args, $apidata);
+ }
+
function show($args, $apidata)
{
parent::handle($args);
diff --git a/lib/router.php b/lib/router.php
index 6fb2f9487..12590b790 100644
--- a/lib/router.php
+++ b/lib/router.php
@@ -231,12 +231,12 @@ class Router
$m->connect('api/statuses/:method',
array('action' => 'api',
'apiaction' => 'statuses'),
- array('method' => '(public_timeline|friends_timeline|user_timeline|update|replies|friends|followers|featured)(\.(atom|rss|xml|json))?'));
+ array('method' => '(public_timeline|friends_timeline|user_timeline|update|replies|mentions|friends|followers|featured)(\.(atom|rss|xml|json))?'));
$m->connect('api/statuses/:method/:argument',
array('action' => 'api',
'apiaction' => 'statuses'),
- array('method' => '(user_timeline|friends_timeline|replies|show|destroy|friends|followers)'));
+ array('method' => '(user_timeline|friends_timeline|replies|mentions|show|destroy|friends|followers)'));
// users