eggheads / eggdrop

The Eggdrop IRC Bot
GNU General Public License v2.0
510 stars 84 forks source link

validation method for udefs #65

Open thommey opened 14 years ago

thommey commented 14 years ago
Trac Data
Ticket 65
Reported by @thommey
Status new
Component Module: channels.mod
Priority minor
Milestone 1.8.0
Version 1.8.0 CVS

In March, we had a suggestion about how setudefs could be validated. The suggestions were a) a callback proc specified with the setudef, b) an udef bind which returns 0/1 depending on whether to allow the change. This has been requested again, so.. worth bringing it up again

thommey commented 14 years ago

Comment by @Pixelz It is possible to validate udefs in 1.6 by replacing *dcc:chanset with your own proc, validating the setting, and then calling the stock chanset command from there.

I welcome a better solution to do this though. I personally like the callback idea, but for eggdrop philosophy reasons I can see why it doesn't make sense.

For the bind idea, I suggest returning 0 to allow the change, and anything else to deny the change, taking the return value as output to the user.

A callback seems much cleaner to me though...

Pixelz commented 8 years ago

As discussed in #158, look into adding "pair" as an udef type as part of this.