From 7a9054bb3f033c98067b3196378311dae54c5fbf Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Tue, 20 Jan 2026 01:31:53 +0000
Subject: [PATCH] =OperationQueue refactor to the JVBase/managers/queue namespace

---
 inc/rest/routes/FavouritesRoutes.php |   16 +++++++++++-----
 1 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/inc/rest/routes/FavouritesRoutes.php b/inc/rest/routes/FavouritesRoutes.php
index b1483b3..a5de911 100644
--- a/inc/rest/routes/FavouritesRoutes.php
+++ b/inc/rest/routes/FavouritesRoutes.php
@@ -33,6 +33,7 @@
         add_action('before_delete_post', [$this, 'cleanupPostFavourites']);
         add_action('delete_term', [$this, 'cleanupTermFavourites'], 10, 3);
 
+		add_action('jvbUserRegistered', [$this, 'maybeAcceptListInvite'], 10, 3);
 
         // Register cleanup scheduler
         add_action('jvb_cleanupOrphanedFavourites', [$this, 'cleanupOrphanedFavourites']);
@@ -272,14 +273,12 @@
 				$by_type[$type][] = (int)$fav->target_id;
 			}
 
-			$response_data = [
+			return [
 				'success' => true,
 				'items'		=> $by_type,
 				'has_more'	=> false,
 			];
 
-			return $response_data;
-
 		} catch (Exception $e) {
 			$this->logError(
 				$e->getMessage(),
@@ -2863,10 +2862,10 @@
             $list_name,
             $inviteButton,
             $inviteUrl,
-            jvbSignature()
+            JVB()->email()->signature()
         );
 
-        return jvbMail($email, $subject, $message);
+        return JVB()->email()->sendEmail($email, $subject, $message);
     }
 
     /**
@@ -3110,6 +3109,13 @@
         }
     }
 
+	public function maybeAcceptListInvite(int $user_id, string $email, array $data):void
+	{
+		if (array_key_exists('list_token', $data) && !empty($data['list_token'])) {
+			$this->acceptListInvitation($data['list_token'], $email);
+		}
+	}
+
     /**
      * Get the owner ID for a content item
      *

--
Gitblit v1.10.0