]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Merge branch '0.7.x' of git@gitorious.org:laconica/dev into 0.7.x
authorRobin Millette <millette@controlyourself.ca>
Fri, 17 Apr 2009 16:47:18 +0000 (16:47 +0000)
committerRobin Millette <millette@controlyourself.ca>
Fri, 17 Apr 2009 16:47:18 +0000 (16:47 +0000)
actions/grouprss.php
actions/showgroup.php
js/util.js
lib/twitterapi.php
scripts/jabberqueuehandler.php
scripts/publicqueuehandler.php
scripts/xmppconfirmhandler.php
scripts/xmppdaemon.php

index a9a2eef877c442396424ada89c55eab7289e27b8..0b7280a11c33648584096b95176eafb63fea7835 100644 (file)
@@ -34,7 +34,7 @@ if (!defined('LACONICA')) {
 
 require_once INSTALLDIR.'/lib/rssaction.php';
 
-define('MEMBERS_PER_SECTION', 81);
+define('MEMBERS_PER_SECTION', 27);
 
 /**
  * Group RSS feed
index 025f8383a276d56ab61dfa51ac830fac177ed06e..a7df397273af91e940b8fa816745add5df24f728 100644 (file)
@@ -35,7 +35,7 @@ if (!defined('LACONICA')) {
 require_once INSTALLDIR.'/lib/noticelist.php';
 require_once INSTALLDIR.'/lib/feedlist.php';
 
-define('MEMBERS_PER_SECTION', 81);
+define('MEMBERS_PER_SECTION', 27);
 
 /**
  * Group main page
@@ -361,7 +361,7 @@ class ShowgroupAction extends Action
              $this->element('p', null, _('(None)'));
         }
 
-        if ($cnt == MEMBERS_PER_SECTION) {
+        if ($cnt > MEMBERS_PER_SECTION) {
             $this->element('a', array('href' => common_local_url('groupmembers',
                                                                  array('nickname' => $this->group->nickname))),
                            _('All members'));
index 81139744ff9cdab7eb928df3f2e83a5df5611562..38d2a9a424febe7a067aba0199131f705d8b13d6 100644 (file)
@@ -166,28 +166,36 @@ $(document).ready(function(){
                                                                                                                                                   $("#notice_action-submit").addClass("disabled");
                                                                                                                                                   return true;
                                                                                                                                                 },
-                                          success: function(xml) {     if ($("#error", xml).length > 0 || $("#command_result", xml).length > 0) {
+                                          success: function(xml) {     if ($("#error", xml).length > 0) {
                                                                                                        var result = document._importNode($("p", xml).get(0), true);
                                                                                                        result = result.textContent || result.innerHTML;
                                                                                                        alert(result);
                                                                                                }
                                                                                                else {
-                                                                                                       $("#notices_primary .notices").prepend(document._importNode($("li", xml).get(0), true));
+                                                                                                   if ($("#command_result", xml).length > 0) {
+                                                                                                           var result = document._importNode($("p", xml).get(0), true);
+                                                                                                           result = result.textContent || result.innerHTML;
+                                                                                                           alert(result);
+                                                    }
+                                                    else {
+                                                                                                           $("#notices_primary .notices").prepend(document._importNode($("li", xml).get(0), true));
+                                                                                                           counter();
+                                                                                                           $("#notices_primary .notice:first").css({display:"none"});
+                                                                                                           $("#notices_primary .notice:first").fadeIn(2500);
+                                                                                                           NoticeHover();
+                                                                                                           NoticeReply();
+                                                                                                       }
                                                                                                        $("#notice_data-text").val("");
-                                                                                                       counter();
-                                                                                                       $("#notices_primary .notice:first").css({display:"none"});
-                                                                                                       $("#notices_primary .notice:first").fadeIn(2500);
-                                                                                                       NoticeHover();
-                                                                                                       NoticeReply();
                                                                                                }
                                                                                                $("#form_notice").removeClass("processing");
                                                                                                $("#notice_action-submit").removeAttr("disabled");
                                                                                                $("#notice_action-submit").removeClass("disabled");
                                                                                         }
                                           };
-       $("#form_notice").ajaxForm(PostNotice);
-       $("#form_notice").each(addAjaxHidden);
-
+    if (document.body.id  != 'inbox' && document.body.id != 'outbox') {
+           $("#form_notice").ajaxForm(PostNotice);
+           $("#form_notice").each(addAjaxHidden);
+    }
     NoticeHover();
     NoticeReply();
 });
index b8357c6889545e9a1f5d191b1401637fd0a09e94..6a90b4e2885701d83c99cfe93d08ac0afdf48161 100644 (file)
@@ -418,7 +418,7 @@ class TwitterapiAction extends Action
     function date_twitter($dt)
     {
         $t = strtotime($dt);
-        return date("D M d G:i:s O Y", $t);
+        return date("D M d H:i:s O Y", $t);
     }
 
     // XXX: Candidate for a general utility method somewhere?
index 924fc45453ecc2ef08d5b570962c38d27ab6d839..8b6e974c0aa7af3a87cca507ccfbf10f4d6b1920 100755 (executable)
@@ -54,6 +54,13 @@ class JabberQueueHandler extends XmppQueueHandler
     }
 }
 
+// Abort immediately if xmpp is not enabled, otherwise the daemon chews up
+// lots of CPU trying to connect to unconfigured servers
+if (common_config('xmpp','enabled')==false) {
+    print "Aborting daemon - xmpp is disabled\n";
+    exit();
+}
+
 ini_set("max_execution_time", "0");
 ini_set("max_input_time", "0");
 set_time_limit(0);
@@ -63,4 +70,4 @@ $resource = ($argc > 1) ? $argv[1] : (common_config('xmpp','resource') . '-queue
 
 $handler = new JabberQueueHandler($resource);
 
-$handler->runOnce();
\ No newline at end of file
+$handler->runOnce();
index 5075c12df578aeeec4f45ce8db0bc430902dfe6f..b0fa22d438e6a66c0c3931e33965a739e4afe087 100755 (executable)
@@ -52,6 +52,13 @@ class PublicQueueHandler extends XmppQueueHandler
     }
 }
 
+// Abort immediately if xmpp is not enabled, otherwise the daemon chews up
+// lots of CPU trying to connect to unconfigured servers
+if (common_config('xmpp','enabled')==false) {
+    print "Aborting daemon - xmpp is disabled\n";
+    exit();
+}
+
 ini_set("max_execution_time", "0");
 ini_set("max_input_time", "0");
 set_time_limit(0);
index 2b8b085ce8ec568ba2f1fad4cd000e3816ab2b3c..7f39235fed8464f7e3847990c3976d75e7bd05b8 100755 (executable)
@@ -140,6 +140,13 @@ class XmppConfirmHandler extends XmppQueueHandler
     }
 }
 
+// Abort immediately if xmpp is not enabled, otherwise the daemon chews up
+// lots of CPU trying to connect to unconfigured servers
+if (common_config('xmpp','enabled')==false) {
+    print "Aborting daemon - xmpp is disabled\n";
+    exit();
+}
+
 ini_set("max_execution_time", "0");
 ini_set("max_input_time", "0");
 set_time_limit(0);
index ef3f8c63d862472d52d3af9e725e7c1262797ce9..0ce2f2a28008397867de795afd36d1b0cf943cea 100755 (executable)
@@ -321,6 +321,13 @@ class XMPPDaemon extends Daemon
     }
 }
 
+// Abort immediately if xmpp is not enabled, otherwise the daemon chews up
+// lots of CPU trying to connect to unconfigured servers
+if (common_config('xmpp','enabled')==false) {
+    print "Aborting daemon - xmpp is disabled\n";
+    exit();
+}
+
 ini_set("max_execution_time", "0");
 ini_set("max_input_time", "0");
 set_time_limit(0);