$this->show_xml_timeline($notice);
break;
case 'rss':
- $this->show_rss_timeline($notice, $title, $id, $link, $subtitle);
+ $this->show_rss_timeline($notice, $title, $link, $subtitle);
break;
case 'atom':
$this->show_atom_timeline($notice, $title, $id, $link, $subtitle);
# FriendFeed's SUP protocol
# Also added RSS and Atom feeds
-
+
$suplink = common_local_url('sup', NULL, $user->id);
header('X-SUP-ID: '.$suplink);
-
+
# XXX: since
$notice = $user->getNotices((($page-1)*20), $count, $since_id, $before_id);
$this->show_xml_timeline($notice);
break;
case 'rss':
- $this->show_rss_timeline($notice, $title, $id, $link, $subtitle, $suplink);
+ $this->show_rss_timeline($notice, $title, $link, $subtitle, $suplink);
break;
case 'atom':
$this->show_atom_timeline($notice, $title, $id, $link, $subtitle, $suplink);
return;
}
- foreach ($_POST as $p => $v) {
- common_debug("_POST: $p = $v");
- }
-
$this->auth_user = $apidata['user'];
$user = $this->auth_user;
$status = $this->trimmed('status');
// errror? -- Zach
return;
- } else if (mb_strlen($status) > 140) {
+// } else if (mb_strlen($status) > 140) {
+ } else {
+
+ $status = common_shorten_links($status);
- // XXX: Twitter truncates anything over 140, flags the status
- // as "truncated." Sending this error may screw up some clients
- // that assume Twitter will truncate for them. Should we just
- // truncate too? -- Zach
- $this->client_error(_('That\'s too long. Max notice size is 140 chars.'), $code = 406, $apidata['content-type']);
- return;
+ if (mb_strlen($status) > 140) {
+
+ // XXX: Twitter truncates anything over 140, flags the status
+ // as "truncated." Sending this error may screw up some clients
+ // that assume Twitter will truncate for them. Should we just
+ // truncate too? -- Zach
+ $this->client_error(_('That\'s too long. Max notice size is 140 chars.'), $code = 406, $apidata['content-type']);
+ return;
+
+ }
}
// Check for commands
}
}
- $notice = Notice::saveNew($user->id, $status, $source, 1, $reply_to);
+ $notice = Notice::saveNew($user->id, html_entity_decode($status, ENT_NOQUOTES, 'UTF-8'),
+ $source, 1, $reply_to);
if (is_string($notice)) {
$this->server_error($notice);
$this->show_xml_timeline($notices);
break;
case 'rss':
- $this->show_rss_timeline($notices, $title, $id, $link, $subtitle);
+ $this->show_rss_timeline($notices, $title, $link, $subtitle);
break;
case 'atom':
$this->show_atom_timeline($notices, $title, $id, $link, $subtitle);