statistics
People Online: 13
Today's Visitors: 429
Total Visitors: 3,727,939
February 07, 2012, 04:55:36 PM
Shoutbox
   
 
[Guest] [joshmiller83]: Can we get an Astrolabe fix please? Or has WIM stopped being developed?
[DevTeam] [Astaldo]: You can disable wim2wim for now or visit the forum thread where you originally posted the issue
[DevTeam] [Zeke]: Yay for spam!
[DevTeam] [Zeke]: ....
[DevTeam] [Zeke]: I love that I get emailed when someone reports spam on the boards, but I can't do anything about it.
[DevTeam] [Nachonut]: lol i got you
[DevTeam] [Astaldo]: How about "hide email address from public checked" and it's still visible in all my posts...
[DevTeam] [Astaldo]: I'd delete my account on this site, but by the time I realized the problem half the spambots on the planet had it already
[Developer] [Pazza]: Astaldo if you log out and view your profile with a refresh you'll see that your email is hidden.
[Developer] [Pazza]: Your user level on the forums permit you to see emails even though they are marked hidden.
[DevTeam] [Astaldo]: Ah.. thanks for the clarification and apologies for "crying wolf" in that case :
[DevTeam] [Kaidenn]: PAZZA! i miss you.
[DevTeam] [Nachonut]: Lol, it's funny how it takes spam message reports to get me to come back
[DevTeam] [sylvanaar]: Check out the beta tester forum. Need alpha testers and feedback so I can come up with a maintenance plan.
[Developer] [Pazza]: loaded some new spam prevention modules... lets see if this stops the bastards.
[DevTeam] [Maziel]: Thought I'd check in and say Howdy Doody from Australia
[DevTeam] [Maziel]: Yeah the spam from shoes salesmen was becoming insane
[Guest] [Delakando]: What ever happened to the ability to track friend's location by wim? Other then just showing their general zone location.
Zeke pokes his head around the corner.
[DevTeam] [Zeke]: Anybody home?
[Guest] [Theillur]: I would like to know if it is just me.
[Guest] [Theillur]: http://www.wimaddon.com/forums/index.php/topic,1796.0.html
[Guest] [Nev]: I'm here
[Guest] [Nev]: I don't think anyone else is though
[Guest] [tomasio]: great site [url=http://freeonlinemusicvideos.net].[/url] [url=http://freepeopleclothing.org].[/url]
[Guest] [Theillur]: Nev it is not working for Zeke as well.
[DevTeam] [lothaer]: im here
[DevTeam] [lothaer]: ...
lothaer yawns sleepily.
[DevTeam] [lothaer]: sooooooooooooooooo
[Guest] [j3ff]: Hello. It is very quiet. I would love a response to my thread directly below your "Been very quiet" thread!
[DevTeam] [lothaer]: Check out my new post in the Skins forum
[DevTeam] [lothaer]: Posted a new download in the skins forum check it out
[DevTeam] [lothaer]: Zeke, Maziel, Pazza, Nachonut, sylvanaar, Kaidenn, Astaldo where are you?
[DevTeam] [lothaer]: It would be a real shame if WIM was left to die.
[DevTeam] [lothaer]: i think these forums are dead, Sylvanaar dosnt post on them as he only bug fixes when possible. WIMs future isnt very bright
[Guest] [justgiz]: Yea, its rather sad.
[Guest] [silvercola]: I wish it had skype
[DevTeam] [lothaer]: noy possible for a addon to do.
[DevTeam] [lothaer]: ...........
[Guest] [elzershark]: where is the download file?
lothaer beckons everyone over to you.
[DevTeam] [lothaer]: has anyone been able to take WIM to the beta yet?
[DevTeam] [lothaer]: PTR*
[DevTeam] [Maziel]: *sticks head up and looks around*
lothaer cries.
[DevTeam] [lothaer]: who the hell flagged my post as spam?
[Guest] [primalforce]: Hey guys
[DevTeam] [lothaer]: hello Primalforce.
[DevTeam] [lothaer]: PAZZA COME BACK!!!
 
   
   
News: World of Warcraft v4.0.1
 
Pages: [1]
Print
Author Topic: CraftList2 and WIM 2.4.14+ (WIM_ChatFrame_MessageEventHandler)  (Read 3910 times)
Astaldo
Beta Tester
Jr. Member
*

Karma: +1/-0
Offline Offline

Posts: 61


View Profile
« on: April 22, 2008, 08:00:48 AM »

CraftList2 (http://files.wowace.com/CraftList2/CraftList2.zip)
contains this block of code to work with WIM versions prior to 2.4.14
and suppress the auto-response messages it sends from the crafter's chatwindow.
Code:
if IsAddOnLoaded("WIM") then
self:Hook("WIM_ChatFrame_MessageEventHandler",function(event, internalEvent)
if arg1 and arg1~="" then
if (string.sub(arg1,1,string.len(prefix_ench))==prefix_ench and not self.db.realm.showrequests and self.db.realm.trigger_ench and event=="CHAT_MSG_WHISPER") then return end
if (string.sub(arg1,1,string.len(prefix_gem))==prefix_gem and not self.db.realm.showrequests and self.db.realm.trigger_gem and event=="CHAT_MSG_WHISPER") then return end
if (string.sub(arg1,1,string.len(prefix_other))==prefix_other and not self.db.realm.showrequests and self.db.realm.trigger_other and event=="CHAT_MSG_WHISPER") then return end
if (string.sub(arg1,1,string.len(prefix_answers))==prefix_answers and not self.db.realm.showanswers and event=="CHAT_MSG_WHISPER_INFORM") then return end
end
return self.hooks["WIM_ChatFrame_MessageEventHandler"](event, internalEvent)
end,
true)
end

With the removal of WIM_ChatFrame_MessageEventHandler this obviously needs re-working.
Any tips on how authors should tackle this in current WIM versions?

Or is this redundant and can just be removed...
Logged
Pazza
Administrator
Hero Member
*****

Karma: +89/-15
Offline Offline

Posts: 1375


Effin A


View Profile WWW
« Reply #1 on: April 22, 2008, 08:12:31 AM »

There are two ways to fix this...

1. Hook the new function. WIM_MessageEventHandler which I no longer recommend although it would work. or

2. Use the new MessageEventFilter API which blizzard added in WoW 2.4. WIM respects all of the default fault chat frame's event filters. Therefore, it is the best way to suppress any addon's messages. This API isn't intended for end user usage, however, addon developers should adopt this new functionality.

I don't feel like writing my own instructions to use this API so check out the WoW UI forums and a little googling around. If you still need help, I'll try to help you the best I can.

Hope this answers anyone's questions.


PS: for user hacks to make their addons work, just replace strings WIM_ChatFrame_MessageEventHandler with WIM_MessageEventHandler
Logged

My hobbies consume way too much time :-).
Pazza
Administrator
Hero Member
*****

Karma: +89/-15
Offline Offline

Posts: 1375


Effin A


View Profile WWW
« Reply #2 on: April 22, 2008, 08:24:22 AM »

You know what.. here is an example of how to use it.
Code:
-- step one would be to write a function which would define your filter.
-- in this case, check if msg == something CraftList created, if so block it.

function MyEventFilter(msg)
     if(i want this message to be shown) then
        -- false says "Do not block this message"
        return false, msg
     else
         --if I do not want it to be shown
         -- true says, YES BLOCK THIS MESSAGE! :-)
         return true, msg;
     end
end

-- second step would be to register your filter with the API.
-- the first argument is what event to listen for. In this case we want CHAT_MSG_WHISPER and CHAT_MSG_WHISPER_INFORM. The second argument is your event filter.

ChatFrame_AddMessageEventFilter("CHAT_MSG_WHISPER", MyEventFilter);
ChatFrame_AddMessageEventFilter("CHAT_MSG_WHISPER_INFORM", MyEventFilter);



As an extra... This logic can be applied in order to detect triggers which your addons use. You can do all these checks from within your event filter. Aslo, if you want, you can modify the passed argument msg. This is why msg must be returned as well.

The API was added so addons would have a safe way to tap into the chat events without having to make sloppy hooks of blizzards chat frame hooks.

I hope this helps.
Logged

My hobbies consume way too much time :-).
Astaldo
Beta Tester
Jr. Member
*

Karma: +1/-0
Offline Offline

Posts: 61


View Profile
« Reply #3 on: April 22, 2008, 08:31:40 AM »

Above and beyond the call of duty.  Grin

More than helpful I have to say, thanks.
Logged
Pazza
Administrator
Hero Member
*****

Karma: +89/-15
Offline Offline

Posts: 1375


Effin A


View Profile WWW
« Reply #4 on: April 22, 2008, 08:45:32 AM »

Glad to help. Keep up the good work with your addon.
Logged

My hobbies consume way too much time :-).
Gilora
Newbie
*

Karma: +0/-0
Offline Offline

Posts: 23


View Profile
« Reply #5 on: May 05, 2008, 11:51:54 PM »

I made a post on the Wowace forums about this (yeah it was a while ago...been busy Tongue)

Here's the link in case anyone's interested:

http://www.wowace.com/forums/index.php?topic=6642.msg207379#msg207379
Logged
Pages: [1]
Print
Jump to:  

You must be logged in to send a message to the shout box.
     
  test stamp