]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/TwitterBridge/daemons/twitterstatusfetcher.php
truncate retweeted stuff if it's too long
[quix0rs-gnu-social.git] / plugins / TwitterBridge / daemons / twitterstatusfetcher.php
index 06c59959a796eb7f6b22757b543d166789d5de54..e897cc6ea0e7f215a1edc89cadb2a233c2b5cb6c 100755 (executable)
@@ -274,11 +274,18 @@ class TwitterStatusFetcher extends ParallelizingDaemon
                 $content = sprintf(_('RT @%1$s %2$s'),
                                    $author->nickname,
                                    $original->content);
+
+                if (Notice::contentTooLong($content)) {
+                    $contentlimit = Notice::maxContent();
+                    $content = mb_substr($content, 0, $contentlimit - 4) . ' ...';
+                }
+
                 $repeat = Notice::saveNew($profile->id,
                                           $content,
                                           'twitter',
                                           array('repeat_of' => $original->id,
-                                                'uri' => $statusUri));
+                                                'uri' => $statusUri,
+                                                'is_local' => Notice::GATEWAY));
                 common_log(LOG_INFO, "Saved {$repeat->id} as a repeat of {$original->id}");
                 Notice_to_status::saveNew($repeat->id, $status->id);
                 return $repeat;