View Single Post
02-07-14, 08:44 AM   #3
suicidalkatt
A Rage Talon Dragon Guard
 
suicidalkatt's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2008
Posts: 331
Originally Posted by Phanx View Post
Probably:
Code:
local orig = BNToastFrame_AddToast
function BNToastFrame_AddToast(toastType, toastData)
     if toastType ~= 3 or toastData ~= "OQ" then
         return orig(toastType, toastData)
     end
end
On a side note, there's no need to attach Blizzard UI files to posts; you can just link to one of the several online mirrors of the code. Some even let you link directly to a specific line.
More just for convenience. I'd rather be able to bring the file up in Notepad++ with a click or two.

Lua Code:
  1. local orig = BNToastFrame_AddToast
  2. function BNToastFrame_AddToast(toastType, toastData)
  3.      if toastData ~= "OQ" then
  4.          return orig(toastType, toastData)
  5.      end
  6. end

Think those conditionals would make more sense. Pass any 'BN_TOAST_TYPE_BROADCAST' that's not "OQ".

I'll give it a try.

Edit: Removed the check on toastType.

Edit 2: After doing a bit of testing, toastData would never be 'OQ' as a string. It would pass the friend id to be used with 'BNGetFriendInfoByID'.

Edit 3: More testing has revealed that the exact string has changed to '(OQ) ' which does include that space.

Lua Code:
  1. local orig = BNToastFrame_AddToast
  2. function BNToastFrame_AddToast(toastType, toastData)
  3.     if toastType == 3 then
  4.         local text = select(12,BNGetFriendInfoByID(toastData))
  5.         if text and text ~= "(OQ) " then -- Exact string, perhaps using string.find would be more appropriate.
  6.             orig(toastType, toastData)
  7.         end
  8.     else
  9.         orig(toastType, toastData)
  10.     end
  11. end

Last edited by suicidalkatt : 02-07-14 at 09:36 AM.
  Reply With Quote