]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - classes/Profile_tag_subscription.php
better output for registration confirmation
[quix0rs-gnu-social.git] / classes / Profile_tag_subscription.php
index f666fe51a0e5ffc3a989cf78d2a682003c0a0ff7..031405f531983c5b30ea2a43c2db51d93a6faddf 100644 (file)
@@ -50,8 +50,8 @@ class Profile_tag_subscription extends Memcached_DataObject
 
             if (!$result) {
                 common_log_db_error($sub, 'INSERT', __FILE__);
-                // TRANS: Exception thrown when inserting a people tag subscription in the database fails.
-                throw new Exception(_('Adding people tag subscription failed.'));
+                // TRANS: Exception thrown when inserting a list subscription in the database fails.
+                throw new Exception(_('Adding list subscription failed.'));
             }
 
             $ptag = Profile_list::staticGet('id', $peopletag->id);
@@ -77,8 +77,8 @@ class Profile_tag_subscription extends Memcached_DataObject
 
             if (!$result) {
                 common_log_db_error($sub, 'DELETE', __FILE__);
-                // TRANS: Exception thrown when deleting a people tag subscription from the database fails.
-                throw new Exception(_('Removing people tag subscription failed.'));
+                // TRANS: Exception thrown when deleting a list subscription from the database fails.
+                throw new Exception(_('Removing list subscription failed.'));
             }
 
             $peopletag->subscriberCount(true);
@@ -102,4 +102,24 @@ class Profile_tag_subscription extends Memcached_DataObject
             Event::handle('StartUnsubscribePeopletag', array($profile_list, $profile));
         }
     }
+
+    function insert()
+    {
+        $result = parent::insert();
+        if ($result) {
+            self::blow('profile_list:subscriber_count:%d', 
+                       $this->profile_tag_id);
+        }
+        return $result;
+    }
+
+    function delete()
+    {
+        $result = parent::delete();
+        if ($result) {
+            self::blow('profile_list:subscriber_count:%d', 
+                       $this->profile_tag_id);
+        }
+        return $result;
+    }
 }