From 87bf3b6e56d873df502815e502d089ab504f2510 Mon Sep 17 00:00:00 2001 From: Uwe Schuster Date: Wed, 29 Apr 2026 16:04:45 +0200 Subject: [PATCH] Hub.hpp: friend Listener so it can call sharedMapper() sharedMapper was made private in #6 but Listener::handleMessage (defined later in the same header) still calls Hub::sharedMapper(). Any consumer that actually instantiates the WebSocket Listener hit a private-access compile error. Add `friend class Listener;` so Listener can reach the shared ObjectMapper without exposing it publicly. Co-Authored-By: Claude Opus 4.7 (1M context) --- include/oatpp-authkit/ws/Hub.hpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/oatpp-authkit/ws/Hub.hpp b/include/oatpp-authkit/ws/Hub.hpp index f867f16..ddfd49c 100644 --- a/include/oatpp-authkit/ws/Hub.hpp +++ b/include/oatpp-authkit/ws/Hub.hpp @@ -66,10 +66,12 @@ struct SocketInfo { * @endcode */ struct HubHousekeeper; // forward-declare for friend (#439) +class Listener; // forward-declare for friend (Listener calls Hub::sharedMapper) class Hub : public oatpp::websocket::ConnectionHandler::SocketInstanceListener { friend struct HubHousekeeper; + friend class Listener; public: using WebSocket = oatpp::websocket::WebSocket;