]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/facebookaction.php
Remove Twitter bridge stuff. The relevant info has been moved to
[quix0rs-gnu-social.git] / lib / facebookaction.php
index 5cbb9be5312bf2ff50907cbc06dd41b31cc5a342..3f3a8d3b094b44cde2f94385d60247e49257eef1 100644 (file)
@@ -35,7 +35,6 @@ if (!defined('STATUSNET') && !defined('LACONICA'))
 require_once INSTALLDIR.'/lib/facebookutil.php';
 require_once INSTALLDIR.'/lib/noticeform.php';
 
-
 class FacebookAction extends Action
 {
 
@@ -181,7 +180,6 @@ class FacebookAction extends Action
 
     }
 
-
     // Make this into a widget later
     function showLocalNav()
     {
@@ -241,7 +239,6 @@ class FacebookAction extends Action
         $this->endHTML();
     }
 
-
     function showInstructions()
     {
 
@@ -257,13 +254,8 @@ class FacebookAction extends Action
         $this->elementStart('dd');
         $this->elementStart('p');
         $this->text(sprintf($loginmsg_part1, common_config('site', 'name')));
-        if (!common_config('site', 'openidonly')) {
-            $this->element('a',
-                array('href' => common_local_url('register')), _('Register'));
-        } else {
-            $this->element('a',
-                array('href' => common_local_url('openidlogin')), _('Register'));
-        }
+        $this->element('a',
+            array('href' => common_local_url('register')), _('Register'));
         $this->text($loginmsg_part2);
     $this->elementEnd('p');
         $this->elementEnd('dd');
@@ -272,7 +264,6 @@ class FacebookAction extends Action
         $this->elementEnd('div');
     }
 
-
     function showLoginForm($msg = null)
     {
 
@@ -317,7 +308,6 @@ class FacebookAction extends Action
 
     }
 
-
     function updateProfileBox($notice)
     {
 
@@ -399,7 +389,6 @@ class FacebookAction extends Action
         $this->xw->openURI('php://output');
     }
 
-
     /**
      * Generate pagination links
      *
@@ -458,8 +447,9 @@ class FacebookAction extends Action
         } else {
             $content_shortened = common_shorten_links($content);
 
-            if (mb_strlen($content_shortened) > 140) {
-                $this->showPage(_('That\'s too long. Max notice size is 140 chars.'));
+            if (Notice::contentTooLong($content_shortened)) {
+                $this->showPage(sprintf(_('That\'s too long. Max notice size is %d chars.'),
+                                        Notice::maxContent()));
                 return;
             }
         }
@@ -478,11 +468,11 @@ class FacebookAction extends Action
 
         $replyto = $this->trimmed('inreplyto');
 
-        $notice = Notice::saveNew($user->id, $content,
-            'web', 1, ($replyto == 'false') ? null : $replyto);
-
-        if (is_string($notice)) {
-            $this->showPage($notice);
+        try {
+            $notice = Notice::saveNew($user->id, $content,
+                                      'web', 1, ($replyto == 'false') ? null : $replyto);
+        } catch (Exception $e) {
+            $this->showPage($e->getMessage());
             return;
         }