View Single Post
10/01/14, 04:28 AM   #2
Ayantir
 
Ayantir's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 1,019
Lua Code:
  1. local function ChatMessageChannel(messageType, fromName, text)
  2.    
  3.     if messageType == CHAT_CHANNEL_WHISPER then
  4.    
  5.         -- Don't zo_strformat UserId's
  6.         local pstPerson
  7.         if string.find(from, "@") == nil then
  8.             pstPerson = zo_strformat(SI_UNIT_NAME, fromName)
  9.         end
  10.        
  11.         d(pstPerson)
  12.        
  13.         if (IsFriend(pstPerson)) then
  14.             d("A friend just whispered you")
  15.         end
  16.        
  17.     end
  18.    
  19. end
  20.  
  21. ZO_ChatSystem_AddEventHandler(EVENT_CHAT_MESSAGE_CHANNEL, ChatMessageChannel)

I didn't checked it, but it should work as intended, no?

Last edited by Ayantir : 10/01/14 at 04:37 AM.
  Reply With Quote