• 1 page(s)
need for LibChatFilter?

I recently started trying to create a customizable message filtering system and found out it is easy to read messages and do extra processing but it's quite hard to actually remove messages.  I ended up looking at SpamMeNot and there seems to be a ton of code in there just to implement interception.

It would seem like a general lib for doing this would be helpful to a lot of chat addon developers.

Does anyone else think this would be a good idea?  Does anyone know if something like this is being worked on?  If not, I may take a stab but don't have much extra time (beyond that used to play WAR Wink) so it would definitely take me a while to write it.

Report this thread post

I think it's a good idea, except I would take it a couple steps further and make it a Library for a few more things as well.  Namely, some functions for sending messages to a channel or player.  Perhaps call it LibChatFunctions or something.

I also think it would be a good idea to have a default filter setup for addons.  Meaning that if a message starts with certain special characters (like !!--!) it is automatically filtered.  This would allow addon authors to send synch messages and anyone who had the library installed would have them filtered out (even if they didn't have the addon that was trying to synch).

I can't think of anything else beyond sending/filtering, but I'm sure there is something i am missing.


[edited by: SidSixSeven at 1:42 PM (GMT -6) on 31 Oct 2008]

Report this thread post

Sending message to a chat channel is somewhat easy to do if you are writing your own addon. Add this to your OnUpdate Method

 

function MyAddon.OnUpdate()

if activate == true then

SystemData.UserInput.ChatText = texttosend

BroadcastEvent(SystemData.Events.SEND_CHAT_TEXT)

activate = false

end

end

Make sure you have the globals vars "texttosend" and "activate = false" defined. Then to send text simply

function MyAddon.SaySomething(input)

local s = StringToWString(input)

local channel = L"/s" -- or whatever channel you want

texttosend = channel..L" "..s

activate = true

end

 

That should work fairly well I think, I use it at any rate.

 


[edited by: macaran at 3:10 PM (GMT -6) on 31 Oct 2008]

Report this thread post

Agreed. But the point of a library is to have common functions so that authors don't need to keep recreating the wheel.  As simple as your solution is, simply using something like LibChat.Send(msg,channel) would be even better imho.

Report this thread post
  • 1 page(s)
Subscribe to this thread: (you will receive emails when new posts are made)