Limit the amount of outgoing addon messages from the addon

The AMR addon likes to send addon messages.
Even in situations where it doesn’t make sense.
I would say the only reasons to do so is a proper raid or guild to share gear-lists.

I am not sure how this is supposed to work and i am not entirely happy about the current state of “research”, but here is my current suggestion.

function Amr:SendAmrCommMessage(message, channel)
-- prepend version to all messages
local v = GetAddOnMetadata(Amr.ADDON_NAME, "Version")
message = v .. "\r" .. message
if IsInRaid() and select(2,IsInInstance() ~= pvp) then
	Amr:SendCommMessage(Amr.ChatPrefix, message, "RAID")
end
if IsInGroup(LE_PARTY_CATEGORY_INSTANCE) then
	print("Instancetype:",select(2,IsInInstance()))
	Amr:SendCommMessage(Amr.ChatPrefix, message, "INSTANCE_CHAT")
end
end

still thinking about better checks to send messages only if they make sense. The “InstanceChat” versus “party”
is not good enough yet.
(In BGs sending to raid makes wow unhappy)

How/where are you seeing it send messages? It should only send one message to the addon channel when your UI loads right now.

Either by
instrumenting addons with “print(“addonname-sends-stuff”)” in their SendAddonMessage block
or
by using YouAren’tInAPartyFix that does a generic hooking.

In the most recent case right after leaving a lost battleground.

I can turn off the version information that the addon communicates with other users of the addon… it used to be used for some features but is not at the moment.

Are you really noticing an impact from this? I have never noticed it causing any issues. They are pretty small messages with a low amount of processing required for each message.

Right now the only combinations that are proofed as noticeable are
“RAID” inside a battleground
“GUILD” if you are not in a guild.
because they print “you aren’t in a X” to the chat.
There is at least one other that i haven’t found out yet.

It is not a problem in terms of amount of messages or lag.
Just thought it should be done correctly from the start instead of relying on wow to ignore messages with the wrong target channel.

Some kind of “who benefits from the loot the most” feature with shared lists is what i expected behind these messages. :slight_smile:

Are you seeing it print a message like “you aren’t in a raid” right now when doing a battleground?