View Single Post
12-24-12, 03:38 AM   #8
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Originally Posted by gmarco View Post
But frankly I don't understand how to write in others players GUILD/OFFICER/RAID channel using the AddMessage.
You can't.

Originally Posted by gmarco View Post
They both can write in my ChatFrames, but I don't understand IF AddMessage can write in other players GUILD/OFFICER/RAID/INSTANCE_CHAT like SendChatMessage does.
It can't.

Here's an example of how it works:

1. Someone (maybe you) uses the SendChatMessage function to send a message to the GUILD channel.

2. The server receives the message, and sends it back to every player who is in the same GUILD channel.

3. Your client receives the message, and fires the CHAT_MSG_GUILD event to inform the UI (including addons) that a message was received in the GUILD channel.

4. The default UI processes the CHAT_MSG_GUILD event, formats the mesage with the channel and sender names, and calls the AddMesssage method on each of the default chat frames that are configured to show messages in the GUILD channel.

AddMessage is a frame method, just like SetAlpha or ClearAllPoints, that all ScrollingMessageFrame type frames have. You can't call AddMessage for a chat frame on someone else's computer any more than you can call SetAlpha on a frame on someone else's computer.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote