| | |
| | | { |
| | | // delete from cache |
| | | if ($cache_index[$headers->id] && $cache_index[$headers->id] == $headers->uid) |
| | | $this->remove_message_cache($cache_key, $headers->id); |
| | | $this->remove_message_cache($cache_key, $headers->uid); |
| | | |
| | | $deleted_count++; |
| | | continue; |
| | |
| | | // other message at this position |
| | | if (isset($cache_index[$id])) |
| | | { |
| | | $this->remove_message_cache($cache_key, $id); |
| | | $this->remove_message_cache($cache_key, $cache_index[$id]); |
| | | unset($cache_index[$id]); |
| | | } |
| | | |
| | |
| | | if (!empty($cache_index)) |
| | | { |
| | | foreach ($cache_index as $id => $uid) |
| | | $this->remove_message_cache($cache_key, $id); |
| | | $this->remove_message_cache($cache_key, $uid); |
| | | } |
| | | } |
| | | |
| | |
| | | { |
| | | foreach ($uids as $uid) |
| | | if ($cached_headers = $this->get_cached_message($cache_key, $uid)) |
| | | $this->remove_message_cache($cache_key, $this->_uid2id($uid)); |
| | | $this->remove_message_cache($cache_key, $uid); |
| | | |
| | | // close and re-open connection |
| | | // this prevents connection problems with Courier |
| | |
| | | /** |
| | | * @access private |
| | | */ |
| | | function remove_message_cache($key, $index) |
| | | function remove_message_cache($key, $uid) |
| | | { |
| | | if (!$this->caching_enabled) |
| | | return; |
| | |
| | | "DELETE FROM ".get_table_name('messages')." |
| | | WHERE user_id=? |
| | | AND cache_key=? |
| | | AND idx=?", |
| | | AND uid=?", |
| | | $_SESSION['user_id'], |
| | | $key, |
| | | $index); |
| | | $uid); |
| | | } |
| | | |
| | | /** |