Pass the `$type` parameter to the ignore getters
authorTim Düsterhus <duesterhus@woltlab.com>
Tue, 16 Mar 2021 10:42:09 +0000 (11:42 +0100)
committerTim Düsterhus <duesterhus@woltlab.com>
Thu, 22 Apr 2021 10:03:46 +0000 (12:03 +0200)
com.woltlab.wcf/templates/boxRecentActivitySidebar.tpl
com.woltlab.wcf/templates/commentList.tpl
com.woltlab.wcf/templates/commentResponseList.tpl
com.woltlab.wcf/templates/recentActivityListItem.tpl
com.woltlab.wcf/templates/userInformationButtons.tpl
wcfsetup/install/files/lib/page/RecentActivityListPage.class.php
wcfsetup/install/files/lib/system/box/AbstractCommentListBoxController.class.php
wcfsetup/install/files/lib/system/box/RecentActivityListBoxController.class.php
wcfsetup/install/files/lib/system/comment/manager/UserProfileCommentManager.class.php

index 8efd42805f0eacaf221d66d1db5e2131fa715195..a40b43cc35baa5594b76d8856ce71b8957fc4077 100644 (file)
@@ -1,6 +1,6 @@
 <ul class="sidebarItemList">
        {foreach from=$eventList item=event}
-               <li class="box24{if $__wcf->getUserProfileHandler()->isIgnoredUser($event->getUserProfile()->userID)} ignoredUserContent{/if}">
+               <li class="box24{if $__wcf->getUserProfileHandler()->isIgnoredUser($event->getUserProfile()->userID, 2)} ignoredUserContent{/if}">
                        {user object=$event->getUserProfile() type='avatar24' ariaHidden='true' tabindex='-1'}
                        
                        <div class="sidebarItemTitle">
index 1ee58c12ab7e17639aeed686ad8ef30d6626fecb..79705f375fb9f52d07855eb78172788fbae5537d 100644 (file)
@@ -12,7 +12,7 @@
                        data-can-edit="{if $comment->isEditable()}true{else}false{/if}" data-can-delete="{if $comment->isDeletable()}true{else}false{/if}"
                        data-responses="{@$comment->responses}" data-last-response-time="{if $commentLastResponseTime|empty}{@$comment->getLastResponseTime()}{else}{@$commentLastResponseTime}{/if}" data-is-disabled="{@$comment->isDisabled}"
                >
-                       <div class="box48{if $__wcf->getUserProfileHandler()->isIgnoredUser($comment->userID)} ignoredUserContent{/if}">
+                       <div class="box48{if $__wcf->getUserProfileHandler()->isIgnoredUser($comment->userID, 2)} ignoredUserContent{/if}">
                                {user object=$comment->getUserProfile() type='avatar48' ariaHidden='true' tabindex='-1'}
                                
                                <div class="commentContentContainer" itemprop="comment" itemscope itemtype="http://schema.org/Comment">
index 6cb3b40637fdbfb9b101631767665e11ec6bffec..a3a9f26ca1420b4d1741392b57af44be7f65e55f 100644 (file)
@@ -5,7 +5,7 @@
                </li>
        {else}
                <li class="commentResponse jsCommentResponse" data-response-id="{@$response->responseID}" {@$__wcf->getReactionHandler()->getDataAttributes('com.woltlab.wcf.comment.response', $response->responseID)} data-can-edit="{if $response->isEditable()}true{else}false{/if}" data-can-delete="{if $response->isDeletable()}true{else}false{/if}" data-user-id="{@$response->userID}">
-                       <div class="box32{if $__wcf->getUserProfileHandler()->isIgnoredUser($response->userID)} ignoredUserContent{/if}">
+                       <div class="box32{if $__wcf->getUserProfileHandler()->isIgnoredUser($response->userID, 2)} ignoredUserContent{/if}">
                                {user object=$response->getUserProfile() type='avatar32' ariaHidden='true' tabindex='-1'}
                                
                                <div class="commentContent commentResponseContent" itemprop="comment" itemscope itemtype="http://schema.org/Comment">
index abd15e3c623506ea7b06f89d274d2bf152de3429..65638ee84ece32130650510432b20dc0981019a8 100644 (file)
@@ -1,6 +1,6 @@
 {foreach from=$eventList item=event}
        <li>
-               <div class="box48{if $__wcf->getUserProfileHandler()->isIgnoredUser($event->getUserProfile()->userID)} ignoredUserContent{/if}">
+               <div class="box48{if $__wcf->getUserProfileHandler()->isIgnoredUser($event->getUserProfile()->userID, 2)} ignoredUserContent{/if}">
                        {user object=$event->getUserProfile() type='avatar48' ariaHidden='true' tabindex='-1'}
                        
                        <div>
index 63bdbfd20585c61f6365d0b022d5e1d47a3a9819..41558108a6539563778c70494720e6ca9fa93217 100644 (file)
@@ -13,7 +13,7 @@
                                {/if}
                                
                                {if $__wcf->user->userID && $user->userID != $__wcf->user->userID}
-                                       {if !$__wcf->getUserProfileHandler()->isIgnoredByUser($user->userID)}
+                                       {if !$__wcf->getUserProfileHandler()->isIgnoredByUser($user->userID, 1)}
                                                {if $__wcf->getUserProfileHandler()->isFollowing($user->userID)}
                                                        <li class="jsOnly"><a href="#" data-following="1" data-object-id="{@$user->userID}" class="jsFollowButton jsTooltip" title="{lang}wcf.user.button.unfollow{/lang}"><span class="icon icon16 fa-minus"></span> <span class="invisible">{lang}wcf.user.button.unfollow{/lang}</span></a></li>
                                                {else}
index 8b2c9c397c3a0eb8904a2e5aa89649bf3453fc33..609b1dbe82e30400d8f5ea12f9145af453845a04 100644 (file)
@@ -3,6 +3,7 @@
 namespace wcf\page;
 
 use wcf\data\user\activity\event\ViewableUserActivityEventList;
+use wcf\data\user\ignore\UserIgnore;
 use wcf\system\page\PageLocationManager;
 use wcf\system\request\LinkHandler;
 use wcf\system\user\activity\event\UserActivityEventHandler;
@@ -44,10 +45,10 @@ class RecentActivityListPage extends AbstractPage
 
         $this->eventList = new ViewableUserActivityEventList();
 
-        if (!empty(UserProfileHandler::getInstance()->getIgnoredUsers())) {
+        if (!empty(UserProfileHandler::getInstance()->getIgnoredUsers(UserIgnore::TYPE_HIDE_MESSAGES))) {
             $this->eventList->getConditionBuilder()->add(
                 "user_activity_event.userID NOT IN (?)",
-                [UserProfileHandler::getInstance()->getIgnoredUsers()]
+                [UserProfileHandler::getInstance()->getIgnoredUsers(UserIgnore::TYPE_HIDE_MESSAGES)]
             );
         }
 
index bb8d33dcebb5523361210eaa1557d86f7098fe93..ea25d1a748208f5b2d0c689e689a48021edbf610 100644 (file)
@@ -5,6 +5,7 @@ namespace wcf\system\box;
 use wcf\data\comment\ViewableCommentList;
 use wcf\data\object\type\ObjectType;
 use wcf\data\object\type\ObjectTypeCache;
+use wcf\data\user\ignore\UserIgnore;
 use wcf\system\exception\InvalidObjectTypeException;
 use wcf\system\user\UserProfileHandler;
 use wcf\system\WCF;
@@ -93,10 +94,10 @@ abstract class AbstractCommentListBoxController extends AbstractDatabaseObjectLi
 
         $this->applyObjectTypeFilters($commentList);
 
-        if (!empty(UserProfileHandler::getInstance()->getIgnoredUsers())) {
+        if (!empty(UserProfileHandler::getInstance()->getIgnoredUsers(UserIgnore::TYPE_HIDE_MESSAGES))) {
             $commentList->getConditionBuilder()->add(
                 "(comment.userID IS NULL OR comment.userID NOT IN (?))",
-                [UserProfileHandler::getInstance()->getIgnoredUsers()]
+                [UserProfileHandler::getInstance()->getIgnoredUsers(UserIgnore::TYPE_HIDE_MESSAGES)]
             );
         }
 
index 91c39bfea6bb8b272176c043a5becba59b3111ef..5052c3217484ebafceb3dec980d670a5f5290519 100644 (file)
@@ -3,6 +3,7 @@
 namespace wcf\system\box;
 
 use wcf\data\user\activity\event\ViewableUserActivityEventList;
+use wcf\data\user\ignore\UserIgnore;
 use wcf\system\condition\IObjectListCondition;
 use wcf\system\request\LinkHandler;
 use wcf\system\user\activity\event\UserActivityEventHandler;
@@ -165,10 +166,10 @@ class RecentActivityListBoxController extends AbstractDatabaseObjectListBoxContr
                     [WCF::getUserProfileHandler()->getFollowingUsers()]
                 );
             }
-        } elseif (!empty(UserProfileHandler::getInstance()->getIgnoredUsers())) {
+        } elseif (!empty(UserProfileHandler::getInstance()->getIgnoredUsers(UserIgnore::TYPE_HIDE_MESSAGES))) {
             $this->objectList->getConditionBuilder()->add(
                 "user_activity_event.userID NOT IN (?)",
-                [UserProfileHandler::getInstance()->getIgnoredUsers()]
+                [UserProfileHandler::getInstance()->getIgnoredUsers(UserIgnore::TYPE_HIDE_MESSAGES)]
             );
         }
 
index 1bcfa0df8b1e106f56306682bb5e002bb97d2238..e67cbb54427f0167d887686c8a745cf52c387188 100644 (file)
@@ -7,6 +7,7 @@ use wcf\data\comment\CommentList;
 use wcf\data\comment\response\CommentResponse;
 use wcf\data\comment\response\CommentResponseList;
 use wcf\data\object\type\ObjectTypeCache;
+use wcf\data\user\ignore\UserIgnore;
 use wcf\system\cache\runtime\UserProfileRuntimeCache;
 use wcf\system\like\IViewableLikeProvider;
 use wcf\system\request\LinkHandler;
@@ -82,7 +83,7 @@ class UserProfileCommentManager extends AbstractCommentManager implements IViewa
                 return false;
             }
 
-            if ($userProfile->isIgnoredUser(WCF::getUser()->userID)) {
+            if ($userProfile->isIgnoredUser(WCF::getUser()->userID, UserIgnore::TYPE_BLOCK_DIRECT_CONTACT)) {
                 return false;
             }
         }