diff options
author | Sarven Capadisli <csarven@status.net> | 2009-10-18 15:12:18 +0000 |
---|---|---|
committer | Sarven Capadisli <csarven@status.net> | 2009-10-18 15:12:18 +0000 |
commit | b0ddbe75a36f42f69a52885ca1e132ff4ef60df7 (patch) | |
tree | f6b904062a98c92dcb6a376b7e77b962479473bb | |
parent | eaaa01a1713b14f48b9889bfbe7f91a9ddd60fd5 (diff) | |
parent | e48efd322279fd67168957635fa30cf4cb46f81b (diff) |
Merge branch '0.9.x' of git@gitorious.org:statusnet/mainline into 0.9.x
-rw-r--r-- | actions/facebooksettings.php | 11 | ||||
-rw-r--r-- | lib/facebookutil.php | 4 |
2 files changed, 11 insertions, 4 deletions
diff --git a/actions/facebooksettings.php b/actions/facebooksettings.php index 84bdde910..b2b1d6807 100644 --- a/actions/facebooksettings.php +++ b/actions/facebooksettings.php @@ -58,8 +58,15 @@ class FacebooksettingsAction extends FacebookAction $this->flink->set_flags($noticesync, $replysync, false, false); $result = $this->flink->update($original); + if ($prefix == '' || $prefix == '0') { + // Facebook bug: saving empty strings to prefs now fails + // http://bugs.developers.facebook.com/show_bug.cgi?id=7110 + $trimmed = $prefix . ' '; + } else { + $trimmed = substr($prefix, 0, 128); + } $this->facebook->api_client->data_setUserPreference(FACEBOOK_NOTICE_PREFIX, - substr($prefix, 0, 128)); + $trimmed); if ($result === false) { $this->showForm(_('There was a problem saving your sync preferences!')); @@ -101,7 +108,7 @@ class FacebooksettingsAction extends FacebookAction $this->elementStart('li'); - $prefix = $this->facebook->api_client->data_getUserPreference(FACEBOOK_NOTICE_PREFIX); + $prefix = trim($this->facebook->api_client->data_getUserPreference(FACEBOOK_NOTICE_PREFIX)); $this->input('prefix', _('Prefix'), ($prefix) ? $prefix : null, diff --git a/lib/facebookutil.php b/lib/facebookutil.php index f5121609d..c991c5439 100644 --- a/lib/facebookutil.php +++ b/lib/facebookutil.php @@ -99,8 +99,8 @@ function facebookBroadcastNotice($notice) // XXX: Does this call count against our per user FB request limit? // If so we should consider storing verb elsewhere or not storing - $prefix = $facebook->api_client->data_getUserPreference(FACEBOOK_NOTICE_PREFIX, - $fbuid); + $prefix = trim($facebook->api_client->data_getUserPreference(FACEBOOK_NOTICE_PREFIX, + $fbuid)); $status = "$prefix $notice->content"; |