AntonLV %!s(int64=9) %!d(string=hai) anos
pai
achega
06b1c31955

+ 124 - 35
inc/classes/BxDolCmts.php

@@ -850,11 +850,14 @@ class BxDolCmts extends BxDolFactory implements iBxDolReplaceable, iBxDolContent
             return;
         };
 
+        $iObjId = $this->getId();
+        $iObjAthrId = $this->getObjectAuthorId($iObjId);
+
         $iCmtId = 0;
         if(bx_get('Cmt') !== false)
             $iCmtId = bx_process_input(bx_get('Cmt'), BX_DATA_INT);
 
-        $aCmt = $this->_oQuery->getCommentSimple ($this->getId(), $iCmtId);
+        $aCmt = $this->_oQuery->getCommentSimple ($iObjId, $iCmtId);
         if(!$aCmt) {
             echoJson(array('msg' => _t('_No such comment')));
             return;
@@ -865,33 +868,68 @@ class BxDolCmts extends BxDolFactory implements iBxDolReplaceable, iBxDolContent
             return;
         }
 
-        $iCmtAuthorId = $this->_getAuthorId();
+        $iPerformerId = $this->_getAuthorId();
         if(!$this->isRemoveAllowed($aCmt)) {
-            echoJson(array('msg' => $aCmt['cmt_author_id'] == $iCmtAuthorId ? strip_tags($this->msgErrRemoveAllowed()) : _t('_Access denied')));
+            echoJson(array('msg' => $aCmt['cmt_author_id'] == $iPerformerId ? strip_tags($this->msgErrRemoveAllowed()) : _t('_Access denied')));
             return;
         }
 
-        $iCmtObjectId = $this->getId();
-        if($this->_oQuery->removeComment($iCmtObjectId, $aCmt['cmt_id'], $aCmt['cmt_parent_id'])) {
+        if($this->_oQuery->removeComment($iObjId, $iCmtId, $aCmt['cmt_parent_id'])) {
             $this->_triggerComment();
 
             $oStorage = BxDolStorage::getObjectInstance($this->getStorageObjectName());
 
-            $aImages = $this->_oQuery->getFiles($this->_aSystem['system_id'], $aCmt['cmt_id']);
+            $aImages = $this->_oQuery->getFiles($this->_aSystem['system_id'], $iCmtId);
             foreach($aImages as $aImage)
                 $oStorage->deleteFile($aImage['image_id']);
 
-            $this->_oQuery->deleteImages($this->_aSystem['system_id'], $aCmt['cmt_id']);
+            $this->_oQuery->deleteImages($this->_aSystem['system_id'], $iCmtId);
 
             $this->isRemoveAllowed(true);
 
-            $this->deleteMetaInfo ($aCmt['cmt_id']);
-
-            $oZ = new BxDolAlerts($this->_sSystem, 'commentRemoved', $iCmtObjectId, $iCmtAuthorId, array('comment_id' => $aCmt['cmt_id'], 'comment_author_id' => $aCmt['cmt_author_id']));
-            $oZ->alert();
-
-            $oZ = new BxDolAlerts('comment', 'deleted', $aCmt['cmt_id'], $iCmtAuthorId, array('object_system' => $this->_sSystem, 'object_id' => $iCmtObjectId));
-        	$oZ->alert();
+            $this->deleteMetaInfo ($iCmtId);
+
+            bx_alert($this->_sSystem, 'commentRemoved', $iObjId, $iPerformerId, array(
+                'object_author_id' => $iObjAthrId,
+
+                'comment_id' => $iCmtId, 
+                'comment_author_id' => $aCmt['cmt_author_id']
+            ));
+
+            bx_alert('comment', 'deleted', $iCmtId, $iPerformerId, array(
+                'object_system' => $this->_sSystem, 
+                'object_id' => $iObjId, 
+                'object_author_id' => $iObjAthrId,
+                
+                'comment_author_id' => $aCmt['cmt_author_id']
+            ));
+
+            if(!empty($aCmt['cmt_parent_id'])) {
+                $iCmtPrntId = (int)$aCmt['cmt_parent_id'];
+                $aCmtPrnt = $this->_oQuery->getCommentSimple($iObjId, $iCmtPrntId);
+                if(!empty($aCmtPrnt) && is_array($aCmtPrnt)) {
+                    bx_alert($this->_sSystem, 'replyRemoved', $iCmtPrntId, $iPerformerId, array(
+                        'object_id' => $iObjId, 
+                        'object_author_id' => $iObjAthrId,
+                        
+                        'parent_author_id' => $aCmtPrnt['cmt_author_id'],
+                        
+                        'comment_id' => $iCmtId, 
+                        'comment_author_id' => $aCmt['cmt_author_id'],
+                    ));
+
+                    bx_alert('reply', 'deleted', $iCmtId, $iPerformerId, array(
+                        'object_system' => $this->_sSystem, 
+                        'object_id' => $iObjId, 
+                        'object_author_id' => $iObjAthrId,
+
+                        'parent_id' => $iCmtPrntId,
+                        'parent_author_id' => $aCmtPrnt['cmt_author_id'],
+
+                        'comment_author_id' => $aCmt['cmt_author_id'], 
+                    ));
+                }
+            }
 
             echoJson(array('id' => $iCmtId));
             return;
@@ -916,40 +954,91 @@ class BxDolCmts extends BxDolFactory implements iBxDolReplaceable, iBxDolContent
     	BxDolSession::getInstance()->setValue($sKey, 1);
     }
 
-    public function onPostAfter($iId)
+    public function onPostAfter($iCmtId)
     {
-        $iObjectId = (int)$this->getId();
-        $iObjectAuthorId = $this->getObjectAuthorId($iObjectId);
+        $iObjId = (int)$this->getId();
+        $iObjAthrId = $this->getObjectAuthorId($iObjId);
 
-        $aComment = $this->_oQuery->getCommentSimple($iObjectId, $iId);
-        if(empty($aComment) || !is_array($aComment))
+        $aCmt = $this->_oQuery->getCommentSimple($iObjId, $iCmtId);
+        if(empty($aCmt) || !is_array($aCmt))
             return false;
 
-        $iAuthorId = (int)$aComment['cmt_author_id'];
-        $oZ = new BxDolAlerts($this->_sSystem, 'commentPost', $iObjectId, $iAuthorId, array('comment_id' => $iId, 'comment_text' => $aComment['cmt_text'], 'comment_author_id' => $iAuthorId, 'object_author_id' => $iObjectAuthorId));
-        $oZ->alert();
+        $iPerformerId = (int)$aCmt['cmt_author_id'];
+        bx_alert($this->_sSystem, 'commentPost', $iObjId, $iPerformerId, array(
+			'object_author_id' => $iObjAthrId,
+
+        	'comment_id' => $iCmtId, 
+        	'comment_author_id' => $aCmt['cmt_author_id'], 
+        	'comment_text' => $aCmt['cmt_text']
+        ));
+
+        bx_alert('comment', 'added', $iCmtId, $iPerformerId, array(
+        	'object_system' => $this->_sSystem, 
+        	'object_id' => $iObjId, 
+        	'object_author_id' => $iObjAthrId,
+
+        	'comment_author_id' => $aCmt['cmt_author_id'], 
+        	'comment_text' => $aCmt['cmt_text']
+        ));
+
+        if(!empty($aCmt['cmt_parent_id'])) {
+            $iCmtPrntId = (int)$aCmt['cmt_parent_id'];
+            $aCmtPrnt = $this->_oQuery->getCommentSimple($iObjId, $iCmtPrntId);
+            if(!empty($aCmtPrnt) && is_array($aCmtPrnt)) {
+                bx_alert($this->_sSystem, 'replyPost', $iCmtPrntId, $iPerformerId, array(
+                    'object_id' => $iObjId, 
+                    'object_author_id' => $iObjAthrId,
+
+                	'parent_author_id' => $aCmtPrnt['cmt_author_id'],
+
+                	'comment_id' => $iCmtId,
+                	'comment_author_id' => $aCmt['cmt_author_id'], 
+                	'comment_text' => $aCmt['cmt_text']
+                ));
+
+                bx_alert('comment', 'replied', $iCmtId, $iPerformerId, array(
+                	'object_system' => $this->_sSystem, 
+                	'object_id' => $iObjId, 
+                	'object_author_id' => $iObjAthrId,
+ 
+                	'parent_id' => $iCmtPrntId,
+                	'parent_author_id' => $aCmtPrnt['cmt_author_id'],
+
+                	'comment_author_id' => $aCmt['cmt_author_id'],  
+                	'comment_text' => $aCmt['cmt_text']
+                ));
+            }
+        }
 
-        $oZ = new BxDolAlerts('comment', 'added', $iId, $iAuthorId, array('object_system' => $this->_sSystem, 'object_id' => $iObjectId, 'object_author_id' => $iObjectAuthorId, 'comment_text' => $aComment['cmt_text']));
-        $oZ->alert();
-        
         return true;
     }
 
-    public function onEditAfter($iId)
+    public function onEditAfter($iCmtId)
     {
-        $iObjectId = (int)$this->getId();
-    	$iObjectAuthorId = $this->getObjectAuthorId($iObjectId);
+        $iObjId = (int)$this->getId();
+    	$iObjAthrId = $this->getObjectAuthorId($iObjId);
 
-    	$aComment = $this->_oQuery->getCommentSimple($iObjectId, $iId);
-        if(empty($aComment) || !is_array($aComment))
+    	$aCmt = $this->_oQuery->getCommentSimple($iObjId, $iCmtId);
+        if(empty($aCmt) || !is_array($aCmt))
             return false;
 
-        $iAuthorId = (int)$aComment['cmt_author_id'];
-        $oZ = new BxDolAlerts($this->_sSystem, 'commentUpdated', $iObjectId, $iAuthorId, array('comment_id' => $iId, 'comment_author_id' => $iAuthorId, 'object_author_id' => $iObjectAuthorId));
-        $oZ->alert();
+        $iPerformerId = $this->_getAuthorId();
+        bx_alert($this->_sSystem, 'commentUpdated', $iObjId, $iPerformerId, array(
+            'object_author_id' => $iObjAthrId,
 
-        $oZ = new BxDolAlerts('comment', 'edited', $iId, $iAuthorId, array('object_system' => $this->_sSystem, 'object_id' => $iObjectId, 'object_author_id' => $iObjectAuthorId));
-        $oZ->alert();
+            'comment_id' => $iCmtId, 
+            'comment_author_id' => $aCmt['cmt_author_id'], 
+            'comment_text' => $aCmt['cmt_text']        	
+        ));
+
+        bx_alert('comment', 'edited', $iCmtId, $iPerformerId, array(
+            'object_system' => $this->_sSystem, 
+            'object_id' => $iObjId, 
+            'object_author_id' => $iObjAthrId,
+
+            'comment_author_id' => $aCmt['cmt_author_id'],
+            'comment_text' => $aCmt['cmt_text']
+        ));
 
         return true;
     }

+ 41 - 4
modules/base/general/classes/BxBaseModGeneralModule.php

@@ -432,12 +432,15 @@ class BxBaseModGeneralModule extends BxDolModule
                 array('group' => $sModule . '_object', 'type' => 'insert', 'alert_unit' => $sModule, 'alert_action' => 'added', 'module_name' => $sModule, 'module_method' => 'get_notifications_post', 'module_class' => 'Module', 'module_event_privacy' => $sEventPrivacy),
                 array('group' => $sModule . '_object', 'type' => 'update', 'alert_unit' => $sModule, 'alert_action' => 'edited'),
                 array('group' => $sModule . '_object', 'type' => 'delete', 'alert_unit' => $sModule, 'alert_action' => 'deleted'),
-                
+
                 array('group' => $sModule . '_comment', 'type' => 'insert', 'alert_unit' => $sModule, 'alert_action' => 'commentPost', 'module_name' => $sModule, 'module_method' => 'get_notifications_comment', 'module_class' => 'Module', 'module_event_privacy' => $sEventPrivacy),
                 array('group' => $sModule . '_comment', 'type' => 'delete', 'alert_unit' => $sModule, 'alert_action' => 'commentRemoved'),
-                
+
+                array('group' => $sModule . '_reply', 'type' => 'insert', 'alert_unit' => $sModule, 'alert_action' => 'replyPost', 'module_name' => $sModule, 'module_method' => 'get_notifications_reply', 'module_class' => 'Module', 'module_event_privacy' => $sEventPrivacy),
+                array('group' => $sModule . '_reply', 'type' => 'delete', 'alert_unit' => $sModule, 'alert_action' => 'replyRemoved'),
+
                 array('group' => $sModule . '_vote', 'type' => 'insert', 'alert_unit' => $sModule, 'alert_action' => 'doVote', 'module_name' => $sModule, 'module_method' => 'get_notifications_vote', 'module_class' => 'Module', 'module_event_privacy' => $sEventPrivacy),
-				array('group' => $sModule . '_vote', 'type' => 'delete', 'alert_unit' => $sModule, 'alert_action' => 'undoVote'),
+                array('group' => $sModule . '_vote', 'type' => 'delete', 'alert_unit' => $sModule, 'alert_action' => 'undoVote'),
             ),
             'alerts' => array(
                 array('unit' => $sModule, 'action' => 'added'),
@@ -446,7 +449,10 @@ class BxBaseModGeneralModule extends BxDolModule
 
                 array('unit' => $sModule, 'action' => 'commentPost'),
                 array('unit' => $sModule, 'action' => 'commentRemoved'),
-                
+
+                array('unit' => $sModule, 'action' => 'replyPost'),
+                array('unit' => $sModule, 'action' => 'replyRemoved'),
+
                 array('unit' => $sModule, 'action' => 'doVote'),
                 array('unit' => $sModule, 'action' => 'undoVote'),
             )
@@ -507,6 +513,37 @@ class BxBaseModGeneralModule extends BxDolModule
 		);
     }
 
+	/**
+     * Entry post reply for Notifications module
+     */
+    public function serviceGetNotificationsReply($aEvent)
+    {
+    	$CNF = &$this->_oConfig->CNF;
+
+    	$oComment = BxDolCmts::getObjectInstance($CNF['OBJECT_COMMENTS'], 0, false);
+        if(!$oComment || !$oComment->isEnabled())
+            return array();
+
+    	$iParentId = (int)$aEvent['object_id'];
+        $aParentInfo = $oComment->getQueryObject()->getCommentsBy(array('type' => 'id', 'id' => $iParentId));
+        if(empty($aParentInfo) || !is_array($aParentInfo))
+            return array();
+
+        $iObjectId = (int)$aParentInfo['cmt_object_id'];
+		$oComment->init($iObjectId);
+
+		return array(
+		    'object_id' => $iObjectId,
+			'entry_sample' => '_cmt_txt_sample_comment_single',
+			'entry_url' => $oComment->getViewUrl($iParentId),
+			'entry_caption' => strmaxtextlen($aParentInfo['cmt_text'], 20, '...'),
+			'entry_author' => (int)$aParentInfo['cmt_author_id'],
+			'subentry_sample' => '_cmt_txt_sample_reply_to',
+			'subentry_url' => $oComment->getViewUrl((int)$aEvent['subobject_id']),
+			'lang_key' => '', //may be empty or not specified. In this case the default one from Notification module will be used.
+		);
+    }
+
 	/**
      * Entry post vote for Notifications module
      */

+ 25 - 6
modules/base/notifications/classes/BxBaseModNotificationsResponse.php

@@ -18,9 +18,22 @@ class BxBaseModNotificationsResponse extends BxDolAlertsResponse
         parent::__construct();
     }
 
+    /**
+     * Note. Check priprity is IMPORTANT!
+     * Don't swap the checks without a REAL need.
+     */
 	protected function _getObjectOwnerId($aExtras)
     {
-        return is_array($aExtras) && isset($aExtras['object_author_id']) ? (int)$aExtras['object_author_id'] : 0;
+        if(!is_array($aExtras))
+            return 0;
+
+        if(isset($aExtras['parent_author_id']))
+    		return (int)$aExtras['parent_author_id'];
+
+        if(isset($aExtras['object_author_id']))
+    		return (int)$aExtras['object_author_id'];
+
+        return 0;
     }
 
     protected function _getObjectPrivacyView($aExtras)
@@ -28,21 +41,27 @@ class BxBaseModNotificationsResponse extends BxDolAlertsResponse
         return is_array($aExtras) && isset($aExtras['privacy_view']) ? (int)$aExtras['privacy_view'] : $this->_oModule->_oConfig->getPrivacyViewDefault('object');
     }
 
+    /**
+     * Note. Check priprity is NOT IMPORTANT!
+     */
 	protected function _getSubObjectId($aExtras)
     {
-    	if(is_array($aExtras) && isset($aExtras['comment_id']))
+        if(!is_array($aExtras))
+            return 0;
+
+    	if(isset($aExtras['comment_id']))
     		return (int)$aExtras['comment_id'];
 
-   		if(is_array($aExtras) && isset($aExtras['vote_id']))
+   		if(isset($aExtras['vote_id']))
     		return (int)$aExtras['vote_id'];
 
-        if(is_array($aExtras) && isset($aExtras['repost_id']))
+        if(isset($aExtras['repost_id']))
     		return (int)$aExtras['repost_id'];
 
-        if(is_array($aExtras) && isset($aExtras['timeline_post_id']))
+        if(isset($aExtras['timeline_post_id']))
             return (int)$aExtras['timeline_post_id'];
 
-        if(is_array($aExtras) && isset($aExtras['performer_id']))
+        if(isset($aExtras['performer_id']))
             return (int)$aExtras['performer_id'];
 
         return 0;

+ 2 - 0
modules/boonex/english/data/langs/system/en.xml

@@ -1510,6 +1510,8 @@
 	<string name="_cmt_txt_link_show"><![CDATA[Show]]></string>
 	<string name="_cmt_txt_link_reply"><![CDATA[Reply]]></string>
 	<string name="_cmt_txt_or"><![CDATA[or]]></string>
+	<string name="_cmt_txt_sample_comment_single"><![CDATA[comment]]></string>
+	<string name="_cmt_txt_sample_reply_to"><![CDATA[reply to comment]]></string>
 	<string name="_copyright"><![CDATA[&copy; {0} Company]]></string>
 	<string name="_delete"><![CDATA[delete]]></string>
 	<string name="_error occured"><![CDATA[Error occurred]]></string>

+ 3 - 1
modules/boonex/notifications/classes/BxNtfsDb.php

@@ -81,6 +81,8 @@ class BxNtfsDb extends BxBaseModNotificationsDb
 
 					$aQueryParts = $oConnection->getConnectedContentAsSQLParts($this->_sPrefix . "events", 'owner_id', $aParams['owner_id']);
 					$sJoinClause .= ' ' . $aQueryParts['join'];
+
+					$sWhereClause .= "AND `{$this->_sTable}`.`action` <> 'replyPost' ";
 					break;
 
                 case BX_NTFS_TYPE_OBJECT_OWNER_AND_CONNECTIONS:
@@ -89,7 +91,7 @@ class BxNtfsDb extends BxBaseModNotificationsDb
 					$aQueryParts = $oConnection->getConnectedContentAsSQLParts($this->_sPrefix . "events", 'owner_id', $aParams['owner_id']);
 					$sJoinClause .= ' ' . str_replace('INNER', 'LEFT', $aQueryParts['join']);
 
-					$sWhereClause .= $this->prepareAsString("AND (NOT ISNULL(`c`.`content`) || (`{$this->_sTable}`.`owner_id` <> `{$this->_sTable}`.`object_owner_id` AND `{$this->_sTable}`.`object_owner_id`=?)) ", $aParams['owner_id']);
+					$sWhereClause .= $this->prepareAsString("AND ((NOT ISNULL(`c`.`content`) AND `{$this->_sTable}`.`action` <> 'replyPost') || (`{$this->_sTable}`.`owner_id` <> `{$this->_sTable}`.`object_owner_id` AND `{$this->_sTable}`.`object_owner_id`=?)) ", $aParams['owner_id']);
                     break;
 			}
 

+ 1 - 1
modules/boonex/notifications/classes/BxNtfsResponse.php

@@ -87,7 +87,7 @@ class BxNtfsResponse extends BxBaseModNotificationsResponse
     	    )
 		);
     }
-    
+
     protected function getDeleteData(&$oAlert, &$aHandler)
     {
         $aHandlers = $this->_oModule->_oDb->getHandlers(array('type' => 'by_group_key_type', 'group' => $aHandler['group']));

+ 8 - 2
modules/boonex/notifications/classes/BxNtfsTemplate.php

@@ -87,18 +87,19 @@ class BxNtfsTemplate extends BxBaseModNotificationsTemplate
     	if((int)$aEvent['processed'] == 0)
     		$this->_processContent($aEvent);
 
+        $aEvent['content'] = unserialize($aEvent['content']);
+
     	$oPrivacy = $oModule->_oConfig->getPrivacyObject($aEvent['type'] . '_' . $aEvent['action']);
     	if($oPrivacy !== false && !$oPrivacy->check($aEvent['id'])) 
     		return '';
 
         $sService = 'check_allowed_with_content';
-        if(BxDolRequest::serviceExists($aEvent['type'], $sService) && BxDolService::call($aEvent['type'], $sService, array('view', $aEvent['object_id'])) !== CHECK_ACTION_RESULT_ALLOWED)
+        if(BxDolRequest::serviceExists($aEvent['type'], $sService) && BxDolService::call($aEvent['type'], $sService, array('view', $this->_getContentObjectId($aEvent))) !== CHECK_ACTION_RESULT_ALLOWED)
             return '';
 
         list($sOwnerName, $sOwnerUrl, $sOwnerIcon) = $oModule->getUserInfo($aEvent['owner_id']);
         $bAuthorIcon = !empty($sOwnerIcon);
 
-        $aEvent['content'] = unserialize($aEvent['content']);
         $aEvent['content']['owner_name'] = $sOwnerName;
         $aEvent['content']['owner_link'] = $sOwnerUrl;
         $aEvent['content']['owner_icon'] = $sOwnerIcon;
@@ -214,6 +215,11 @@ class BxNtfsTemplate extends BxBaseModNotificationsTemplate
 		return $this->$sMethod($aEvent);
     }
 
+    protected function _getContentObjectId(&$aEvent)
+    {
+        return !empty($aEvent['content']['object_id']) ? (int)$aEvent['content']['object_id'] : (int)$aEvent['object_id'];
+    }
+
     protected function _getContentLangKey(&$aEvent)
     {
     	return !empty($aEvent['subobject_id']) ? '_bx_ntfs_txt_subobject_added' : '_bx_ntfs_txt_object_added';

+ 1 - 0
modules/boonex/notifications/install/langs/en.xml

@@ -23,6 +23,7 @@
 
 	<string name="_bx_ntfs_alert_action_added"><![CDATA[add]]></string>
 	<string name="_bx_ntfs_alert_action_commentPost"><![CDATA[add comment]]></string>
+	<string name="_bx_ntfs_alert_action_replyPost"><![CDATA[reply to own comment]]></string>
 	<string name="_bx_ntfs_alert_action_doVote"><![CDATA[add vote]]></string>
 	<string name="_bx_ntfs_alert_action_timeline_post_common"><![CDATA[post to timeline]]></string> 
 

+ 1 - 0
modules/boonex/russian/data/langs/bx_notifications/ru.xml

@@ -23,6 +23,7 @@
 
 	<string name="_bx_ntfs_alert_action_added"><![CDATA[добавить]]></string>
 	<string name="_bx_ntfs_alert_action_commentPost"><![CDATA[добавить коментарий]]></string>
+	<string name="_bx_ntfs_alert_action_replyPost"><![CDATA[ответ на собственный комментарий]]></string>
 	<string name="_bx_ntfs_alert_action_doVote"><![CDATA[добавить голос]]></string>
 	<string name="_bx_ntfs_alert_action_timeline_post_common"><![CDATA[сообщение на линейке]]></string>
 

+ 3 - 1
modules/boonex/russian/data/langs/system/ru.xml

@@ -1507,7 +1507,9 @@
 	<string name="_cmt_load_more_replies_popular"><![CDATA[Увидеть ещё ответы...]]></string>
 	<string name="_cmt_txt_link_show"><![CDATA[Прочитать]]></string>
 	<string name="_cmt_txt_link_reply"><![CDATA[Ответить]]></string>
-	<string name="_cmt_txt_or"><![CDATA[или]]></string>	
+	<string name="_cmt_txt_or"><![CDATA[или]]></string>
+	<string name="_cmt_txt_sample_comment_single"><![CDATA[комментарий]]></string>
+	<string name="_cmt_txt_sample_reply_to"><![CDATA[ответ на комментарий]]></string>	
 	<string name="_copyright"><![CDATA[&copy; {0} Компания]]></string>
 	<string name="_delete"><![CDATA[удалить]]></string>
 	<string name="_error occured"><![CDATA[Произошла ошибка]]></string>

+ 2 - 1
template/scripts/BxBaseCmts.php

@@ -565,7 +565,8 @@ class BxBaseCmts extends BxDolCmts
                 if($iCmtParentId) {
                     $this->_oQuery->updateRepliesCount($iCmtParentId, 1);
 
-                    $this->_sendNotificationEmail($iCmtId, $iCmtParentId);
+                    if(!BxDolModuleQuery::getInstance()->isEnabledByName('bx_notifications'))
+                        $this->_sendNotificationEmail($iCmtId, $iCmtParentId);
                 }
 
                 $this->_triggerComment();