]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/twitapistatuses.php
add inboxed and regenerate data objects
[quix0rs-gnu-social.git] / actions / twitapistatuses.php
index a33e8cc3b326202789235e75c23b968e7b3e00af..1b095079aabf941e4274f36d398b8c7878797da7 100644 (file)
@@ -128,7 +128,7 @@ class TwitapistatusesAction extends TwitterapiAction {
                        $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);
@@ -193,10 +193,10 @@ class TwitapistatusesAction extends TwitterapiAction {
 
                # 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);
@@ -206,7 +206,7 @@ class TwitapistatusesAction extends TwitterapiAction {
                        $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);
@@ -234,10 +234,6 @@ class TwitapistatusesAction extends TwitterapiAction {
                        return;
                }
 
-               foreach ($_POST as $p => $v) {
-                       common_debug("_POST: $p = $v");
-               }
-
                $this->auth_user = $apidata['user'];
                $user = $this->auth_user;
                $status = $this->trimmed('status');
@@ -256,14 +252,21 @@ class TwitapistatusesAction extends TwitterapiAction {
                        // 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
@@ -298,7 +301,8 @@ class TwitapistatusesAction extends TwitterapiAction {
                                }
                        }
 
-                       $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);
@@ -362,7 +366,7 @@ class TwitapistatusesAction extends TwitterapiAction {
                        $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);