AntonLV 6 лет назад
Родитель
Сommit
e4ed0e62f9
1 измененных файлов с 8 добавлено и 0 удалено
  1. 8 0
      modules/boonex/timeline/classes/BxTimelineModule.php

+ 8 - 0
modules/boonex/timeline/classes/BxTimelineModule.php

@@ -143,6 +143,8 @@ class BxTimelineModule extends BxBaseModNotificationsModule implements iBxDolCon
         if(!$this->_oDb->updateEvent(array('pinned' => $aEvent['pinned']), array('id' => $iId)))
             return echoJson(array('code' => 3));
 
+        $this->_oDb->deleteCache(array('context_id' => $this->_iOwnerId)); //--- Delete cache for context
+
         echoJson(array(
             'code' => 0, 
             'id' => $iId, 
@@ -168,6 +170,9 @@ class BxTimelineModule extends BxBaseModNotificationsModule implements iBxDolCon
     	if(!$this->_oDb->updateEvent(array('sticked' => $aEvent['sticked']), array('id' => $iId)))
             return echoJson(array('code' => 3));
 
+        $this->_oDb->deleteCache(array('context_id' => 0)); //--- Delete cache for Public feed
+        $this->_oDb->deleteCache(array('context_id' => $this->_iOwnerId)); //--- Delete cache for context
+
         bx_audit(
             $iId, 
             $this->getName(), 
@@ -199,6 +204,9 @@ class BxTimelineModule extends BxBaseModNotificationsModule implements iBxDolCon
         if(!$this->_oDb->updateEvent(array('promoted' => $aEvent['promoted']), array('id' => $iId)))
             return echoJson(array('code' => 2));
 
+        $this->_oDb->deleteCache(array('context_id' => 0)); //--- Delete cache for Public feed
+        $this->_oDb->deleteCache(array('context_id' => $this->_iOwnerId)); //--- Delete cache for context
+
         bx_alert($this->_oConfig->getObject('alert'), $sAction . 'd', $iId, (int)$this->getUserId(), array(
             'owner_id' => $aEvent['owner_id'],
             'object_id' => $aEvent['object_id'],