summaryrefslogtreecommitdiff
path: root/plugins/TwitterBridge
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/TwitterBridge')
-rwxr-xr-xplugins/TwitterBridge/daemons/synctwitterfriends.php2
-rw-r--r--plugins/TwitterBridge/twitter.php9
2 files changed, 10 insertions, 1 deletions
diff --git a/plugins/TwitterBridge/daemons/synctwitterfriends.php b/plugins/TwitterBridge/daemons/synctwitterfriends.php
index 671e3c7af..df7da0943 100755
--- a/plugins/TwitterBridge/daemons/synctwitterfriends.php
+++ b/plugins/TwitterBridge/daemons/synctwitterfriends.php
@@ -221,7 +221,7 @@ class SyncTwitterFriendsDaemon extends ParallelizingDaemon
// Twitter friend
if (!save_twitter_user($friend_id, $friend_name)) {
- common_log(LOG_WARNING, $this-name() .
+ common_log(LOG_WARNING, $this->name() .
" - Couldn't save $screen_name's friend, $friend_name.");
continue;
}
diff --git a/plugins/TwitterBridge/twitter.php b/plugins/TwitterBridge/twitter.php
index 508699939..2805b3ab5 100644
--- a/plugins/TwitterBridge/twitter.php
+++ b/plugins/TwitterBridge/twitter.php
@@ -252,8 +252,17 @@ function format_status($notice)
$statustxt = preg_replace('/^@/', ' @', $notice->content);
// Convert !groups to #hashes
+
+ // XXX: Make this an optional setting?
+
$statustxt = preg_replace('/(^|\s)!([A-Za-z0-9]{1,64})/', "\\1#\\2", $statustxt);
+ if (mb_strlen($statustxt) > 140) {
+ $noticeUrl = common_shorten_url($notice->uri);
+ $urlLen = mb_strlen($noticeUrl);
+ $statustxt = mb_substr($statustxt, 0, 140 - ($urlLen + 3)) . ' … ' . $noticeUrl;
+ }
+
return $statustxt;
}