Skip to content

Commit

Permalink
Remove message entries on disable module
Browse files Browse the repository at this point in the history
  • Loading branch information
yurabakhtin committed Feb 22, 2024
1 parent d4aeb69 commit 8a4f53f
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
13 changes: 13 additions & 0 deletions Module.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace humhub\modules\mail;

use humhub\components\console\Application as ConsoleApplication;
use humhub\modules\mail\models\MessageEntry;
use humhub\modules\mail\notifications\MailNotification;
use humhub\modules\mail\notifications\ConversationNotification;
use humhub\modules\mail\permissions\StartConversation;
Expand Down Expand Up @@ -110,4 +111,16 @@ public function hideInTopNav()
return !$this->settings->get('showInTopNav', false);
}

/**
* @inheritdoc
*/
public function disable()
{
foreach (MessageEntry::find()->each() as $messageEntry) {
$messageEntry->delete();
}

parent::disable();
}

}
3 changes: 3 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
Changelog
=========

3.2.1 (Unreleased)
------------------------
- Enh #370: Remove message entries on disable module

3.2.0 (January 29, 2024)
------------------------
Expand Down
2 changes: 1 addition & 1 deletion module.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"messenger",
"communication"
],
"version": "3.2.0",
"version": "3.2.1",
"humhub": {
"minVersion": "1.15"
},
Expand Down

0 comments on commit 8a4f53f

Please sign in to comment.