View Single Post
10/15/14, 03:24 PM   #12
Garkin
 
Garkin's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 832
No didn't try it. But I have checked chat system code and there is no way that chat system will print whisper to the party chat or party message to the whisper. Messages are sorted by category and then printed to the chat to the correct channels.

Lua Code:
  1. category = GetChannelCategoryFromChannel(CHAT_CHANNEL_WHISPER)
  2. --returns CHAT_CATEGORY_WHISPER_INCOMING (3)
  3.  
  4. category = GetChannelCategoryFromChannel(CHAT_CHANNEL_PARTY)
  5. --returns CHAT_CATEGORY_PARTY (7)


If you want to use category the same way as chat system, you can change code to:
Lua Code:
  1. local function ChatMessageChannel(eventCode, messageType, fromName, text, isFromCustomerService)
  2.     if GetChannelCategoryFromChannel(messageType) == CHAT_CATEGORY_WHISPER_INCOMING then
  3.         fromName = IsDecoratedDisplayName(fromName) and fromName or zo_strformat(SI_UNIT_NAME, fromName)
  4.         d(fromName)
  5.         if IsFriend(fromName) then
  6.             d("A friend just whispered you")
  7.         end
  8.     end
  9. end
  10.          
  11. EVENT_MANAGER:RegisterForEvent("MyAddonName", EVENT_CHAT_MESSAGE_CHANNEL, ChatMessageChannel)
But I think it will not make any difference.
  Reply With Quote