Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #832 from xillibit/bugs5

#755 JomSocial: Delete activity stream entries when deleting posts
  • Loading branch information...
commit 9ce818d13624e79c3ed44a3b0d421a7f0ded52e5 2 parents dc1e793 + 13f8ec1
@mahagr mahagr authored
View
5 administrator/components/com_kunena/install/plugins/plg_kunena_community/community/activity.php
@@ -112,6 +112,11 @@ public function onAfterThankyou($target, $actor, $message) {
CActivityStream::add ( $act );
}
+ public function onAfterDeleteTopic($target) {
+ CFactory::load ( 'libraries', 'activities' );
+ CActivityStream::remove ('kunena.post', $target->id );
+ }
+
protected function getAccess($category) {
// Activity access level: 0 = public, 20 = registered, 30 = friend, 40 = private
$accesstype = $category->accesstype;
View
1  administrator/components/com_kunena/libraries/integration/activity.php
@@ -45,6 +45,7 @@ public function onAfterDelete($message) {}
public function onAfterUndelete($message) {}
public function onAfterThankyou($target, $actor, $message) {}
public function onAfterUnThankyou($target, $actor, $message) {}
+ public function onAfterDeleteTopic($message) {}
public function onAfterSubscribe($topicid, $action) {}
public function onAfterFavorite($topicid, $action) {}
View
3  components/com_kunena/controllers/topics.php
@@ -35,6 +35,9 @@ function permdel() {
} else {
foreach ( $topics as $topic ) {
if ($topic->authorise('permdelete') && $topic->delete()) {
+ // Activity integration
+ $activity = KunenaFactory::getActivityIntegration();
+ $activity->onAfterDeleteTopic($topic);
$message = JText::_ ( 'COM_KUNENA_BULKMSG_DELETED' );
} else {
$this->app->enqueueMessage ( $topic->getError (), 'notice' );
Please sign in to comment.
Something went wrong with that request. Please try again.