Anope IRC Services

Please login or register.

Login with username, password and session length
Advanced search  

News:

Pages: [1]   Go Down

Author Topic: [Module Request] Deop on Nick Change/Away  (Read 5375 times)

0 Members and 1 Guest are viewing this topic.

n00bie

  • Anope User
  • Offline Offline
  • Gender: Male
  • Posts: 411
[Module Request] Deop on Nick Change/Away
« on: August 22, 2006, 07:57:14 PM »

Ok, first i wanted to note that i am still in a learning process of writing modules ^^

Lots of people especially my home channel operators on my network are using psyBNC and since it is the home channel, i really need this module. So, i'm trying to code a module which can DEOP a user when he/she change a nick and set his/her nick away. I've tried this mod for 2 weeks and i got no success yet :(

I tried with both 'EVENT_CHANGE_NICK' and createEventHandler("NICK", my_nick); ... but i cant get them working ... what exactly i try to do is ... when a user change his nick, i wanted the mod to check whether his/her newnick is on the access list and if his/her new nick is not on the access list, ChanServ deops/dehalfops the user. And also this will works only if the channel has 'securedops' set. also, the module will works only on the home channel.

So, i will be very glad if someone could write a module for this or give me some hints/suggestions.

Thanks :)
Logged
I am always doing things that which I cannot do, in order that I may learn how to do it.

Tom65789

  • Anope User
  • Offline Offline
  • Posts: 343
    • www.t65789.co.uk
(No subject)
« Reply #1 on: August 22, 2006, 10:02:40 PM »

so you just want a module that deops a user when they change their nick? or when they have it specifically as away? so like

Tom65789

then Tom65789|Away

or could you just use Tom65789|nickchange and it would still deop?

[Edited on 22-8-2006 by Tom65789]

Jan Milants

  • Team
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 1372
(No subject)
« Reply #2 on: August 22, 2006, 10:05:06 PM »

hmmm just hook to a nick change then check whether the user is set as /away i guess...
Logged
If you like me donate coins to 1FBmZVT4J8WAUMHKqpWhgNVj3XXnRN1cCk :)

n00bie

  • Anope User
  • Offline Offline
  • Gender: Male
  • Posts: 411
(No subject)
« Reply #3 on: August 22, 2006, 10:06:18 PM »

* @somenick is now known as somenick|away
[here chanserv checks whether somenick|away is on the chan access list, if not DEOP/DEHFLOPS the new nick]

that was what i meant :)
Logged
I am always doing things that which I cannot do, in order that I may learn how to do it.

katsklaw

  • Guest
(No subject)
« Reply #4 on: August 22, 2006, 10:19:54 PM »

Thought I'd chime in with something here. You may also wish to check if your ircd will pass tokens to services on away. Example is Bahamut while running as a serviceshub. Bahamut has a more efficiant data stream to services when in this mode by not sending tokens to services that it would normally broadcast to other ircds but not to services because it would likely deem useless, thus saving resources and bandwidth. If I remember correctly Bahamut will not broadcast to services when a user sets away because Services really shouldn't care.

A perfect real time example is BotServ public !commands do not work when Bahamut is in serviceshub mode, because it doesn't pass channel "chatter" to services.
Logged

Trystan Scott Lee

  • Contributor
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 343
(No subject)
« Reply #5 on: August 23, 2006, 01:57:07 AM »

the major flaw in this module is that anope can be running and then the module loaded. It can not tell the state of the user to the module.. ie if the user is away the module can not tell this, it can only tell when the user does the away, anope needs a flag in the user struct to indicate the state of the user for this module to be 100% affective otherwise to load you would need to take services offline and bring them back to see the state of the user in channels, which by the way comes before their channels.. so you are told the user is away before you ever see his channels, so the module would also need to keeo track of this state (unless the core was updated to do so) otherwise its flawed in this area
Logged
my God my tourniquet, return to me salvation
Pages: [1]   Go Up