From 75b51f6a33176591e4902942cc47d15e9c790a84 Mon Sep 17 00:00:00 2001 From: Daniel Yates Date: Thu, 2 May 2024 14:48:52 +0100 Subject: [PATCH] Add sendResult to AceComm callback forwarding Most people probably interface with AceComm rather than CTL directly, so it makes sense to pass the send result from CTL fully through the chain. One downside is that because AceComm currently appends its own textLen argument, we're forced to effectively sandwich it by appending sendResult to the end of the list. --- AceComm-3.0/AceComm-3.0.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/AceComm-3.0/AceComm-3.0.lua b/AceComm-3.0/AceComm-3.0.lua index 60d72d9..434795d 100644 --- a/AceComm-3.0/AceComm-3.0.lua +++ b/AceComm-3.0/AceComm-3.0.lua @@ -20,7 +20,7 @@ TODO: Time out old data rotting around from dead senders? Not a HUGE deal since local CallbackHandler = LibStub("CallbackHandler-1.0") local CTL = assert(ChatThrottleLib, "AceComm-3.0 requires ChatThrottleLib") -local MAJOR, MINOR = "AceComm-3.0", 12 +local MAJOR, MINOR = "AceComm-3.0", 13 local AceComm,oldminor = LibStub:NewLibrary(MAJOR, MINOR) if not AceComm then return end @@ -97,8 +97,8 @@ function AceComm:SendCommMessage(prefix, text, distribution, target, prio, callb local ctlCallback = nil if callbackFn then - ctlCallback = function(sent) - return callbackFn(callbackArg, sent, textlen) + ctlCallback = function(sent, sendResult) + return callbackFn(callbackArg, sent, textlen, sendResult) end end