Mercurial > wow > askmrrobot
diff Libs/AceComm-3.0/AceComm-3.0.lua @ 124:e31b02b24488
Updated for 8.0 pre-patch and BfA.
author | yellowfive |
---|---|
date | Tue, 17 Jul 2018 09:57:39 -0700 |
parents | 01b63b8ed811 |
children |
line wrap: on
line diff
--- a/Libs/AceComm-3.0/AceComm-3.0.lua Mon Feb 12 19:34:09 2018 -0800 +++ b/Libs/AceComm-3.0/AceComm-3.0.lua Tue Jul 17 09:57:39 2018 -0700 @@ -9,7 +9,7 @@ -- make into AceComm. -- @class file -- @name AceComm-3.0 --- @release $Id: AceComm-3.0.lua 1107 2014-02-19 16:40:32Z nevcairiel $ +-- @release $Id: AceComm-3.0.lua 1174 2018-05-14 17:29:49Z h.leppkes@gmail.com $ --[[ AceComm-3.0 @@ -17,15 +17,14 @@ ]] -local MAJOR, MINOR = "AceComm-3.0", 9 +local CallbackHandler = LibStub("CallbackHandler-1.0") +local CTL = assert(ChatThrottleLib, "AceComm-3.0 requires ChatThrottleLib") +local MAJOR, MINOR = "AceComm-3.0", 12 local AceComm,oldminor = LibStub:NewLibrary(MAJOR, MINOR) if not AceComm then return end -local CallbackHandler = LibStub:GetLibrary("CallbackHandler-1.0") -local CTL = assert(ChatThrottleLib, "AceComm-3.0 requires ChatThrottleLib") - -- Lua APIs local type, next, pairs, tostring = type, next, pairs, tostring local strsub, strfind = string.sub, string.find @@ -66,7 +65,11 @@ if #prefix > 16 then -- TODO: 15? error("AceComm:RegisterComm(prefix,method): prefix length is limited to 16 characters") end - RegisterAddonMessagePrefix(prefix) + if C_ChatInfo then + C_ChatInfo.RegisterAddonMessagePrefix(prefix) + else + RegisterAddonMessagePrefix(prefix) + end return AceComm._RegisterComm(self, prefix, method) -- created by CallbackHandler end @@ -86,7 +89,7 @@ if not( type(prefix)=="string" and type(text)=="string" and type(distribution)=="string" and - (target==nil or type(target)=="string") and + (target==nil or type(target)=="string" or type(target)=="number") and (prio=="BULK" or prio=="NORMAL" or prio=="ALERT") ) then error('Usage: SendCommMessage(addon, "prefix", "text", "distribution"[, "target"[, "prio"[, callbackFn, callbackarg]]])', 2)