]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - classes/Status_network.php
Updated button.close styles
[quix0rs-gnu-social.git] / classes / Status_network.php
index f8d6756b69090c4c51e7127ba2497e4b0e1a6444..fe4f0b0c580c7f14d8fc0c91150488fc3331abdc 100644 (file)
@@ -2,8 +2,8 @@
 /**
  * Table Definition for status_network
  *
- * Laconica - a distributed open-source microblogging tool
- * Copyright (C) 2009, Control Yourself, Inc.
+ * StatusNet - the distributed open-source microblogging tool
+ * Copyright (C) 2009, StatusNet, Inc.
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as published by
@@ -19,7 +19,7 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-if (!defined('LACONICA')) { exit(1); }
+if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); }
 
 class Status_network extends DB_DataObject
 {
@@ -54,7 +54,7 @@ class Status_network extends DB_DataObject
         global $config;
 
         $config['db']['database_'.$dbname] = "mysqli://$dbuser:$dbpass@$dbhost/$dbname";
-        $config['db']['ini_'.$dbname] = INSTALLDIR.'/classes/statusnet.ini';
+        $config['db']['ini_'.$dbname] = INSTALLDIR.'/classes/status_network.ini';
         $config['db']['table_status_network'] = $dbname;
 
         self::$cache = new Memcache();
@@ -71,7 +71,7 @@ class Status_network extends DB_DataObject
     }
 
     static function cacheKey($k, $v) {
-        return 'laconica:' . self::$base . ':status_network:'.$k.':'.$v;
+        return 'statusnet:' . self::$base . ':status_network:'.$k.':'.$v;
     }
 
     static function memGet($k, $v)
@@ -132,6 +132,13 @@ class Status_network extends DB_DataObject
             }
         } else {
             $sn = self::memGet('hostname', strtolower($servername));
+
+            if (empty($sn)) {
+                // Try for a no-www address
+                if (0 == strncasecmp($servername, 'www.', 4)) {
+                    $sn = self::memGet('hostname', strtolower(substr($servername, 4)));
+                }
+            }
         }
 
         if (!empty($sn)) {