WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   JoinChannelByName enigma (https://www.wowinterface.com/forums/showthread.php?t=58641)

hamunaptra 03-18-21 04:29 PM

JoinChannelByName enigma
 
UDPATE: Nevermind, I'm an idiot... it seems SendChatMessage can only be triggered by a hardware event, not by an addon, thus the error. I'll have to find another way for my addon to talk to other versions of it out there...

---------------

I'm trying to join a channel programmatically through an addon using the following logic:

Code:

JoinChannelByName("mychannel", nil, ChatFrame1:GetID(), false)
however, this seems to join the channel in a way that I cannot actually send or receive anything from/to it:

Code:

local id = GetChannelName("mychannel")
SendChatMessage("testmsg", "CHANNEL", "COMMON", id)

seems to fail:

Code:

Interface action failed because of an AddOn
Which points to a taint issue, but nothing is showing up in the taint.log (using level 1).

I'm confused... how can SendChatMessage raise a taint?

What am I missing?

briskman3000 03-18-21 04:53 PM

If you want your addon to talk to itself on another player, you should probably be using the addon hidden chat message system, and not a custom chat channel

https://wow.gamepedia.com/API_C_Chat...ndAddonMessage

Kanegasi 03-18-21 05:59 PM

Patch 8.2.5 (as well as Classic patch 1.13.3) has partically protected SendChatMessage if you're trying to send to SAY, YELL, or CHANNEL. Those three message destinations require a hardware event in order for addons to use them, such as a key or a click. However, you can freely send to SAY or YELL while in an instance.

hamunaptra 03-19-21 04:45 AM

I switched to SendAddonMessage() but noticed that it seems to work fine in a party, i.e

Code:

C_ChatInfo.SendAddonMessage(prefix, "test")
is received by addons on other clients in the same party just fine, but:

Code:

C_ChatInfo.SendAddonMessage(prefix, "test", "CHANNEL", channelid)
where channelid is the id of a custom channel I joined on all client with

Code:

JoinChannelByName(channelname)
channelid = GetChannelName(channelname)

seems to NOT propagate to the other clients (i.e. CHAT_MSG_ADDON is not fired).

Is SendAddonMessage somehow limited, too for "CHANNEL" or am I doing something completely wrong?


All times are GMT -6. The time now is 04:45 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI