File tree Expand file tree Collapse file tree 8 files changed +106
-0
lines changed
wcfsetup/install/files/lib Expand file tree Collapse file tree 8 files changed +106
-0
lines changed Original file line number Diff line number Diff line change 55use wcf \data \user \follow \UserFollow ;
66use wcf \data \user \follow \UserFollowEditor ;
77use wcf \data \user \User ;
8+ use wcf \event \user \UserFollowed ;
9+ use wcf \system \event \EventHandler ;
810use wcf \system \user \activity \event \UserActivityEventHandler ;
911use wcf \system \user \notification \object \UserFollowUserNotificationObject ;
1012use wcf \system \user \notification \UserNotificationHandler ;
@@ -40,6 +42,8 @@ public function __invoke(): void
4042 $ this ->sendNotification ($ follow );
4143 $ this ->fireActivityEvent ();
4244 $ this ->resetUserStorage ();
45+
46+ EventHandler::getInstance ()->fire (new UserFollowed ($ this ->user , $ this ->target ));
4347 }
4448
4549 private function sendNotification (UserFollow $ follow ): void
Original file line number Diff line number Diff line change 66use wcf \data \file \FileAction ;
77use wcf \data \user \User ;
88use wcf \data \user \UserEditor ;
9+ use wcf \event \user \AvatarChanged ;
910use wcf \system \cache \runtime \UserProfileRuntimeCache ;
11+ use wcf \system \event \EventHandler ;
1012use wcf \system \user \group \assignment \UserGroupAssignmentHandler ;
1113use wcf \system \user \storage \UserStorageHandler ;
1214use wcf \system \user \UserProfileHandler ;
@@ -54,5 +56,7 @@ public function __invoke(): void
5456 if ($ this ->user ->userID === WCF ::getUser ()->userID ) {
5557 UserProfileHandler::getInstance ()->reloadUserProfile ();
5658 }
59+
60+ EventHandler::getInstance ()->fire (new AvatarChanged ($ this ->user , $ this ->file ));
5761 }
5862}
Original file line number Diff line number Diff line change 66use wcf \data \file \FileAction ;
77use wcf \data \user \User ;
88use wcf \data \user \UserEditor ;
9+ use wcf \event \user \CoverPhotoChanged ;
910use wcf \system \cache \runtime \UserProfileRuntimeCache ;
11+ use wcf \system \event \EventHandler ;
1012
1113/**
1214 * Sets the cover photo of a user.
@@ -36,5 +38,7 @@ public function __invoke(): void
3638 'coverPhotoHasWebP ' => 0 ,
3739 ]);
3840 UserProfileRuntimeCache::getInstance ()->removeObject ($ this ->user ->userID );
41+
42+ EventHandler::getInstance ()->fire (new CoverPhotoChanged ($ this ->user , $ this ->file ));
3943 }
4044}
Original file line number Diff line number Diff line change 55use wcf \data \user \follow \UserFollow ;
66use wcf \data \user \follow \UserFollowEditor ;
77use wcf \data \user \User ;
8+ use wcf \event \user \UserUnfollowed ;
9+ use wcf \system \event \EventHandler ;
810use wcf \system \user \activity \event \UserActivityEventHandler ;
911use wcf \system \user \storage \UserStorageHandler ;
1012
@@ -35,6 +37,8 @@ public function __invoke(): void
3537 }
3638
3739 $ this ->resetUserStorage ();
40+
41+ EventHandler::getInstance ()->fire (new UserUnfollowed ($ this ->user , $ this ->target ));
3842 }
3943
4044 private function removeActivityEvent (): void
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace wcf \event \user ;
4+
5+ use wcf \data \file \File ;
6+ use wcf \data \user \User ;
7+ use wcf \event \IPsr14Event ;
8+
9+ /**
10+ * Indicates that the avatar of a user has been changed.
11+ *
12+ * @author Marcel Werk
13+ * @copyright 2001-2025 WoltLab GmbH
14+ * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
15+ * @since 6.2
16+ */
17+ final class AvatarChanged implements IPsr14Event
18+ {
19+ public function __construct (
20+ public readonly User $ user ,
21+ public readonly ?File $ file
22+ ) {}
23+ }
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace wcf \event \user ;
4+
5+ use wcf \data \file \File ;
6+ use wcf \data \user \User ;
7+ use wcf \event \IPsr14Event ;
8+
9+ /**
10+ * Indicates that the cover photo of a user has been changed.
11+ *
12+ * @author Marcel Werk
13+ * @copyright 2001-2025 WoltLab GmbH
14+ * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
15+ * @since 6.2
16+ */
17+ final class CoverPhotoChanged implements IPsr14Event
18+ {
19+ public function __construct (
20+ public readonly User $ user ,
21+ public readonly ?File $ file
22+ ) {}
23+ }
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace wcf \event \user ;
4+
5+ use wcf \data \user \User ;
6+ use wcf \event \IPsr14Event ;
7+
8+ /**
9+ * Indicates that a user is following another user.
10+ *
11+ * @author Marcel Werk
12+ * @copyright 2001-2025 WoltLab GmbH
13+ * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
14+ * @since 6.2
15+ */
16+ final class UserFollowed implements IPsr14Event
17+ {
18+ public function __construct (
19+ public readonly User $ user ,
20+ public readonly User $ target
21+ ) {}
22+ }
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace wcf \event \user ;
4+
5+ use wcf \data \user \User ;
6+ use wcf \event \IPsr14Event ;
7+
8+ /**
9+ * Indicates that a user is unfollowing another user.
10+ *
11+ * @author Marcel Werk
12+ * @copyright 2001-2025 WoltLab GmbH
13+ * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
14+ * @since 6.2
15+ */
16+ final class UserUnfollowed implements IPsr14Event
17+ {
18+ public function __construct (
19+ public readonly User $ user ,
20+ public readonly User $ target
21+ ) {}
22+ }
You can’t perform that action at this time.
0 commit comments