Remove index from rt data when deleting an email from gui

Signed-off-by: Janos SUTO <sj@acts.hu>
This commit is contained in:
Janos SUTO 2022-12-31 08:09:30 +01:00
parent 41600bb8af
commit 8a75e5f62c
2 changed files with 10 additions and 0 deletions

View File

@ -48,6 +48,11 @@ class ControllerMessageBulkremove extends Controller {
} else {
AUDIT(ACTION_REMOVE_MESSAGE, '', '', $id, '');
$db->query("UPDATE " . TABLE_META . " SET retained=? WHERE id=?", [NOW, $id]);
if(RT) {
$sphx = Registry::get('sphx');
$sphx->query("DELETE FROM " . SPHINX_MAIN_INDEX . " WHERE id=" . (int)$this->data['id']);
}
syslog(LOG_INFO, $this->data['username'] . " removed message: $id");
}

View File

@ -40,6 +40,11 @@ class ControllerMessageRemove extends Controller {
AUDIT(ACTION_REMOVE_MESSAGE, '', '', $id, '');
$db->query("UPDATE " . TABLE_META . " SET retained=? WHERE id=?", [NOW, $id]);
$db->query("UPDATE " . TABLE_DELETED . " SET deleted=1 WHERE id=?", [$id]);
if(RT) {
$sphx = Registry::get('sphx');
$sphx->query("DELETE FROM " . SPHINX_MAIN_INDEX . " WHERE id=", (int)$this->data['id']);
}
syslog(LOG_INFO, $this->data['username'] . " removed message: $id");
$this->data['x'] = $this->data['text_successfully_removed'];