Anope IRC Services

Please login or register.

Login with username, password and session length
Advanced search  

News:

Pages: [1]   Go Down

Author Topic: Channel Founder  (Read 3240 times)

0 Members and 1 Guest are viewing this topic.

lavinpj1

  • Guest
Channel Founder
« on: April 18, 2006, 07:51:51 PM »

I am very new to module coding so please bare with me. Is it possible to find out if a particular user is the founder of a channel? This will then enable me to only allow channel founders to use the command.

Thanks in advance

Phil
Logged

Jan Milants

  • Team
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 1372
(No subject)
« Reply #1 on: April 18, 2006, 08:01:04 PM »

here s the syntax t check...

User *u
ChannelInfo *ci

is_real_founder(u, ci)   // 1 for superadmin or chanserv founder
is_founder(u, ci)   // 1 for superadmins or any1 who is identified with cs pass

both return ints..

next time you might wanna check the anope doxy though ... nothing you need to know that you can't find in there


edit: http://anope.zero.org/doxy/extern_8h.html (takes a long time to load - only a few of these in the doxy though) or just plain http://anope.zero.org

[Edited on 18-4-2006 by Viper]
Logged
If you like me donate coins to 1FBmZVT4J8WAUMHKqpWhgNVj3XXnRN1cCk :)

lavinpj1

  • Guest
(No subject)
« Reply #2 on: April 18, 2006, 08:22:03 PM »

Hrmmm, thanks for that. One thing I don't understand is where the ChannelInfo *ci gets the channel name from. How can I assign that variable to the channel info of the contents of another variable.

e.g. I have a variable named channel which is taken from the command entered by the user, /os servjoin #channel, and this is what I want to use to check for founder staus in.

Sorry if i'm slow here.

Thanks

Phil
Logged

Jan Milants

  • Team
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 1372
(No subject)
« Reply #3 on: April 18, 2006, 10:42:36 PM »

if ya have a char *chan where chan is the channelname then

ChannelInfo *ci = cs_findchan(chan);
Channel *c = findchan(chan);

things like this can be easily extracted from allready existing modules though ..
just go over the code of a few modules and ya ll learn a lot :-)

edit: you can put if structures around the ci = cs_findchan(chan) to check whether the chan is registered or actually exists
once again a lot of info regarding these functions can be found in the doxy

[Edited on 18-4-2006 by Viper]

[Edited on 18-4-2006 by Viper]
Logged
If you like me donate coins to 1FBmZVT4J8WAUMHKqpWhgNVj3XXnRN1cCk :)
Pages: [1]   Go Up