]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - classes/Group_block.php
Update copyright dates in files modified in 2009
[quix0rs-gnu-social.git] / classes / Group_block.php
index d945fd57a922ec3ba788658c26107a8a069b768a..7922c19a95040e10d1dc77fd1079b69251b438e4 100644 (file)
@@ -3,7 +3,7 @@
  * Table Definition for group_block
  *
  * Laconica - a distributed open-source microblogging tool
- * Copyright (C) 2008, Controlez-Vous, Inc.
+ * Copyright (C) 2008, 2009, Control Yourself, 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
@@ -92,4 +92,24 @@ class Group_block extends Memcached_DataObject
 
         return $block;
     }
+
+    static function unblockProfile($group, $profile)
+    {
+        $block = Group_block::pkeyGet(array('group_id' => $group->id,
+                                            'blocked' => $profile->id));
+
+        if (empty($block)) {
+            return null;
+        }
+
+        $result = $block->delete();
+
+        if (!$result) {
+            common_log_db_error($block, 'DELETE', __FILE__);
+            return null;
+        }
+
+        return true;
+    }
+
 }