]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - classes/Status_network.php
Annihilate profile_tag_inbox.
[quix0rs-gnu-social.git] / classes / Status_network.php
index 339f4c813b5f6d030bd59cf69c550d8ca3cb1435..5d01e72ccc9041c62f1313891963bf820fdfaa37 100644 (file)
@@ -167,18 +167,17 @@ class Status_network extends Safe_DataObject
             ' WHERE nickname = ' . $this->_quote($this->nickname);
         $orig->decache();
         $result = $this->query($qry);
-        if ($result) {
-            $this->encache();
-        }
+        $this->decache();
+
         return $result;
     }
-    
+
     function delete()
     {
         $this->decache(); # while we still have the values!
         return parent::delete();
     }
-    
+
     /**
      * @param string $servername hostname
      * @param string $wildcard hostname suffix to match wildcard config
@@ -308,14 +307,11 @@ class Status_network extends Safe_DataObject
      */
     function getTags()
     {
-        $result = array();
-        
-        $tags = new Status_network_tag();
-        $tags->site_id = $this->site_id;
-        if ($tags->find()) {
-            while ($tags->fetch()) {
-                $result[] = $tags->tag;
-            }
+        $result = Status_network_tag::getTags($this->site_id);
+
+        // XXX : for backwards compatibility
+        if (empty($result)) {
+            return explode('|', $this->tags);
         }
 
         return $result;
@@ -324,6 +320,7 @@ class Status_network extends Safe_DataObject
     /**
      * Save a given set of tags
      * @param array tags
+     * @fixme only add/remove differentials
      */
     function setTags($tags)
     {
@@ -334,9 +331,10 @@ class Status_network extends Safe_DataObject
                 $snt->site_id = $this->site_id;
                 $snt->tag = $tag;
                 $snt->created = common_sql_now();
-                
+
                 $id = $snt->insert();
                 if (!$id) {
+                    // TRANS: Exception thrown when a tag cannot be saved.
                     throw new Exception(_("Unable to save tag."));
                 }
             }
@@ -358,7 +356,7 @@ class Status_network extends Safe_DataObject
 
         $tag->free();
     }
-    
+
     /**
      * Check if this site record has a particular meta-info tag attached.
      * @param string $tag