From ebb88b7bad674cc9515765d09752ea6a518a72c7 Mon Sep 17 00:00:00 2001
From: Thomas Ives <tri@observatorysciences.co.uk>
Date: Mon, 1 Sep 2025 09:21:17 +0100
Subject: [PATCH 3/5] push_att_conf_events: Use event data to determine vers

Do not need to consider the version of the device pushing the event when
deciding if we need to add the idl5_ prefix to the event name.  Instead,
the thing that matters is who the event is aimed at.  This can be
determined from the SuppliedEventData based on which pointer is not
nullptr.
---
 src/server/eventsupplier.cpp | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/lib/cpp/src/server/eventsupplier.cpp b/lib/cpp/src/server/eventsupplier.cpp
index 696370dce..e66df4a1b 100644
--- a/lib/cpp/src/server/eventsupplier.cpp
+++ b/lib/cpp/src/server/eventsupplier.cpp
@@ -2475,7 +2475,19 @@ void EventSupplier::push_att_conf_events(DeviceImpl *device_impl,
     // Called for AttributeConfig_3 or AttributeConfig_5 ?
     //
 
-    const int vers = device_impl->get_dev_idl_version();
+    int vers;
+    if(attr_conf.attr_conf_5 != nullptr)
+    {
+        vers = 5;
+    }
+    else if(attr_conf.attr_conf_3 != nullptr)
+    {
+        vers = 3;
+    }
+    else
+    {
+        vers = 2;
+    }
 
     //
     // Return if there is no client or if the last client subscription is more than 10 mins ago
-- 
2.39.5

