channels.c File Reference

#include "services.h"
#include "language.h"

Go to the source code of this file.

Defines

#define HASH(chan)   ((chan)[1] ? ((chan)[1]&31)<<5 | ((chan)[2]&31) : 0)

Functions

void add_ban (Channel *chan, char *mask)
void add_exception (Channel *chan, char *mask)
void add_invite (Channel *chan, char *mask)
void chan_adduser2 (User *user, Channel *c)
Channelchan_create (char *chan, time_t ts)
void chan_delete (Channel *c)
void chan_deluser (User *user, Channel *c)
char * chan_get_modes (Channel *chan, int complete, int plus)
int chan_get_user_status (Channel *chan, User *user)
int chan_has_user_status (Channel *chan, User *user, int16 status)
void chan_remove_user_status (Channel *chan, User *user, int16 status)
void chan_set_correct_modes (User *user, Channel *c, int give_modes)
void chan_set_key (Channel *chan, char *value)
void chan_set_modes (const char *source, Channel *chan, int ac, char **av, int check)
void chan_set_user_status (Channel *chan, User *user, int16 status)
void del_ban (Channel *chan, char *mask)
void del_exception (Channel *chan, char *mask)
void del_invite (Channel *chan, char *mask)
void do_cmode (const char *source, int ac, char **av)
void do_join (const char *source, int ac, char **av)
void do_kick (const char *source, int ac, char **av)
void do_mass_mode (char *modes)
void do_part (const char *source, int ac, char **av)
void do_sjoin (const char *source, int ac, char **av)
void do_topic (const char *source, int ac, char **av)
Channelfindchan (const char *chan)
Channelfirstchan (void)
void get_channel_stats (long *nrec, long *memuse)
char * get_flood (Channel *chan)
char * get_key (Channel *chan)
char * get_limit (Channel *chan)
char * get_redirect (Channel *chan)
int is_on_chan (Channel *c, User *u)
Channeljoin_user_update (User *user, Channel *chan, char *name, time_t chants)
Usernc_on_chan (Channel *c, NickCore *nc)
Channelnextchan (void)
void restore_unsynced_topics (void)
void set_flood (Channel *chan, char *value)
void set_limit (Channel *chan, char *value)
void set_redirect (Channel *chan, char *value)

Variables

Channelchanlist [1024]


Define Documentation

#define HASH ( chan   )     ((chan)[1] ? ((chan)[1]&31)<<5 | ((chan)[2]&31) : 0)

Definition at line 20 of file channels.c.

Referenced by add_session(), alpha_insert_alias(), chan_create(), change_core_display(), del_session(), delcore(), delete_user(), delnick(), delnickrequest(), findchan(), findcore(), findnick(), findrequestnick(), finduser(), insert_core(), insert_requestnick(), and main().


Function Documentation

void add_ban ( Channel chan,
char *  mask 
)

Definition at line 1261 of file channels.c.

References alog(), anope_cmd_mode(), channel_::bancount, channel_::bans, channel_::bansize, chaninfo_::bi, BSMinUsers, BSSmartJoin, BUFSIZE, channel_::ci, debug, botinfo_::host, match_wild_nocase(), channel_::name, botinfo_::nick, s_BotServ, snprintf(), srealloc(), sstrdup(), botinfo_::user, and channel_::usercount.

Referenced by anope_event_bmask(), and do_sjoin().

void add_exception ( Channel chan,
char *  mask 
)

Definition at line 1296 of file channels.c.

References alog(), debug, channel_::exceptcount, channel_::excepts, channel_::exceptsize, channel_::name, srealloc(), and sstrdup().

Referenced by anope_event_bmask(), and do_sjoin().

void add_invite ( Channel chan,
char *  mask 
)

Definition at line 1317 of file channels.c.

References alog(), debug, channel_::invite, channel_::invitecount, channel_::invitesize, channel_::name, srealloc(), and sstrdup().

Referenced by anope_event_bmask(), and do_sjoin().

void chan_adduser2 ( User user,
Channel c 
)

Definition at line 1513 of file channels.c.

References anope_cmd_privmsg(), chaninfo_::bi, bot_join(), chaninfo_::botflags, BS_GREET, BSMinUsers, CA_GREET, CA_MEMO, check_access(), channel_::ci, chaninfo_::entry_message, get_ignore(), nickcore_::greet, is_sync(), botinfo_::lastmsg, MemoInfo::memocount, chaninfo_::memos, user_::na, channel_::name, chaninfo_::name, nickalias_::nc, nickalias_::nick, botinfo_::nick, user_::nick, notice_lang(), notice_user(), channel_::c_userlist::prev, s_BotServ, s_MemoServ, scalloc(), user_::server, channel_::c_userlist::user, channel_::usercount, channel_::users, and whosends.

Referenced by join_user_update().

Channel* chan_create ( char *  chan,
time_t  ts 
)

Definition at line 1574 of file channels.c.

References alog(), chaninfo_::c, chanlist, check_modes(), channel_::ci, channel_::creation_time, cs_findchan(), debug, HASH, is_sync(), channel_::name, channel_::next, channel_::prev, restore_topic(), scalloc(), serv_uplink, stick_all(), strscpy(), and channel_::topic_sync.

Referenced by join_user_update().

void chan_delete ( Channel c  ) 

Definition at line 1611 of file channels.c.

References alog(), channel_::bancount, channel_::bans, channel_::bansize, channel_::bd, chaninfo_::c, channel_::ci, debug, ircdvars_::except, channel_::exceptcount, channel_::excepts, channel_::exceptsize, channel_::flood, ircdvars_::fmode, ircd, channel_::key, ircdvars_::Lmode, bandata_::mask, channel_::name, bandata_::next, channel_::redirect, and channel_::topic.

Referenced by chan_deluser().

void chan_deluser ( User user,
Channel c 
)

Definition at line 25 of file channels.c.

References anope_cmd_part(), chaninfo_::bi, BSMinUsers, chan_delete(), channel_::ci, channel_::name, channel_::c_userlist::next, user_::next, botinfo_::nick, s_BotServ, update_cs_lastseen(), channel_::c_userlist::user, channel_::usercount, and channel_::users.

Referenced by delete_user(), do_join(), do_kick(), and do_part().

char* chan_get_modes ( Channel chan,
int  complete,
int  plus 
)

Definition at line 65 of file channels.c.

References BUFSIZE, CBM_MINUS_NO_ARG, cbmodeinfos, cbmodeinfo_::flag, cbmodeinfo_::flags, cbmodeinfo_::getvalue, cbmodeinfo_::mode, and channel_::mode.

Referenced by do_chanlist().

int chan_get_user_status ( Channel chan,
User user 
)

Definition at line 106 of file channels.c.

References user_::chans, and user_::u_chanlist::next.

Referenced by botchanmsgs(), chan_set_correct_modes(), and chan_set_modes().

int chan_has_user_status ( Channel chan,
User user,
int16  status 
)

Definition at line 121 of file channels.c.

References alog(), user_::chans, debug, and user_::u_chanlist::next.

Referenced by do_clear(), do_clearmodes(), and do_register().

void chan_remove_user_status ( Channel chan,
User user,
int16  status 
)

Definition at line 140 of file channels.c.

References alog(), user_::chans, debug, channel_::name, user_::u_chanlist::next, and user_::nick.

Referenced by chan_set_correct_modes(), and chan_set_modes().

void chan_set_correct_modes ( User user,
Channel c,
int  give_modes 
)

Set the correct modes, or remove the ones granted without permission, for the specified user on ths specified channel. This doesn't give modes to ignored users, but does remove them if needed.

Parameters:
user The user to give/remove modes to/from
c The channel to give/remove modes on
give_modes Set to 1 to give modes, 0 to not give modes
Returns:
void

Definition at line 1347 of file channels.c.

References ircdvars_::admin, ircdvars_::adminset, alog(), anope_cmd_mode(), BUFSIZE, CA_AUTODEOP, CA_AUTOHALFOP, CA_AUTOOP, CA_AUTOPROTECT, CA_AUTOVOICE, CA_HALFOPME, CA_OPDEOPME, CA_PROTECTME, chan_get_user_status(), chan_remove_user_status(), chan_set_user_status(), check_access(), channel_::ci, CI_SECUREOPS, CI_VERBOTEN, CUS_DEOPPED, CUS_HALFOP, CUS_OP, CUS_OWNER, CUS_PROTECT, CUS_VOICE, debug, nickcore_::flags, chaninfo_::flags, get_ignore(), ircdvars_::halfop, ircd, is_founder(), is_ulined(), user_::na, server_::name, channel_::name, nickalias_::nc, NI_AUTOOP, user_::nick, ircdvars_::owner, ircdvars_::ownerset, ircdvars_::protect, user_::server, stripModePrefix(), channel_::usercount, and whosends.

Referenced by chan_set_modes(), do_enforce_secureops(), do_join(), do_setmodes(), and do_sjoin().

void chan_set_key ( Channel chan,
char *  value 
)

Definition at line 1852 of file channels.c.

References alog(), debug, channel_::key, channel_::name, and sstrdup().

void chan_set_modes ( const char *  source,
Channel chan,
int  ac,
char **  av,
int  check 
)

Definition at line 158 of file channels.c.

References cmmode_::addmask, alog(), anope_cmd_mode(), CBM_MINUS_NO_ARG, cbmodes, chan_get_user_status(), chan_remove_user_status(), chan_set_correct_modes(), chan_set_user_status(), check_modes(), channel_::ci, cmmodes, CUF_PROTECT_BOTSERV, cumodes, CUS_DEOPPED, CUS_OP, debug, cmmode_::delmask, find_byuid(), findbot(), finduser(), cbmode_::flag, cbmode_::flags, cumode_::flags, ircd, is_on_chan(), merge_args(), channel_::mode, channel_::name, user_::nick, botinfo_::nick, cbmode_::setvalue, cumode_::status, ircdvars_::ts6, UseTS6, and whosends.

Referenced by addBan(), delBan(), do_ban(), do_clear(), do_clearmodes(), do_cmode(), do_deowner(), do_mass_mode(), do_os_mode(), do_owner(), do_sjoin(), do_util(), and stick_all().

void chan_set_user_status ( Channel chan,
User user,
int16  status 
)

Definition at line 327 of file channels.c.

References alog(), CA_AUTOOP, user_::chans, check_access(), channel_::ci, common_svsmode(), CUS_OP, debug, HelpChannel, ircd, channel_::name, user_::u_chanlist::next, user_::nick, stricmp(), and ircdvars_::supporthelper.

Referenced by chan_set_correct_modes(), and chan_set_modes().

void del_ban ( Channel chan,
char *  mask 
)

Definition at line 1688 of file channels.c.

References alog(), channel_::bancount, channel_::bans, channel_::ci, debug, is_stuck(), channel_::name, and stick_mask().

void del_exception ( Channel chan,
char *  mask 
)

Definition at line 1720 of file channels.c.

References channel_::exceptcount, channel_::excepts, and stricmp().

void del_invite ( Channel chan,
char *  mask 
)

Definition at line 1749 of file channels.c.

References channel_::invite, channel_::invitecount, and stricmp().

void do_cmode ( const char *  source,
int  ac,
char **  av 
)

Definition at line 1117 of file channels.c.

References alog(), chan_set_modes(), CI_VERBOTEN, cs_findchan(), debug, findchan(), chaninfo_::flags, ircd, ircdcap, merge_args(), channel_::server_modecount, channel_::server_modetime, ircdvars_::ts6, ircdcapab_::tsmode, uplink_capab, UseTS6, and UseTSMODE.

Referenced by anope_event_mode(), anope_event_tmode(), bot_join(), bot_raw_ban(), bot_raw_mode(), check_kick(), common_unban(), and do_clear().

void do_join ( const char *  source,
int  ac,
char **  av 
)

Definition at line 526 of file channels.c.

References alog(), chan_deluser(), chan_set_correct_modes(), user_::chans, check_kick(), debug, EVENT_JOIN_CHANNEL, EVENT_PART_CHANNEL, EVENT_START, EVENT_STOP, find_byuid(), findchan(), finduser(), ircd, join_user_update(), merge_args(), user_::u_chanlist::next, user_::nick, send_event(), sstrdup(), ircdvars_::ts6, and UseTS6.

Referenced by anope_event_join(), and anope_event_sajoin().

void do_kick ( const char *  source,
int  ac,
char **  av 
)

Definition at line 599 of file channels.c.

References alog(), bot_join(), chan_deluser(), user_::chans, cs_findchan(), debug, EVENT_CHAN_KICK, find_byuid(), findbot(), finduser(), ircd, merge_args(), user_::u_chanlist::next, user_::nick, s_BotServ, send_event(), stricmp(), ircdvars_::ts6, and UseTS6.

Referenced by anope_event_kick(), bot_raw_ban(), bot_raw_kick(), do_akick(), do_ban(), do_clear(), do_cs_kick(), do_enforce_cmode_R(), do_enforce_restricted(), do_forbid(), do_os_kick(), do_suspend(), and sqline().

void do_mass_mode ( char *  modes  ) 

Definition at line 1887 of file channels.c.

References anope_cmd_mode(), channel_::bouncy_modes, chan_set_modes(), channel_::name, channel_::next, s_OperServ, split_buf(), and sstrdup().

Referenced by runDefCon().

void do_part ( const char *  source,
int  ac,
char **  av 
)

Definition at line 663 of file channels.c.

References alog(), chan_deluser(), user_::chans, debug, EVENT_PART_CHANNEL, EVENT_START, EVENT_STOP, find_byuid(), finduser(), ircd, merge_args(), user_::u_chanlist::next, user_::nick, send_event(), sstrdup(), stricmp(), ircdvars_::ts6, and UseTS6.

Referenced by anope_event_part(), and anope_event_sapart().

void do_sjoin ( const char *  source,
int  ac,
char **  av 
)

Definition at line 758 of file channels.c.

References add_ban(), add_exception(), add_invite(), alog(), anope_cmd_kick(), anope_cmd_part(), base64dects(), chaninfo_::bi, bot_join(), chan_set_correct_modes(), chan_set_modes(), ircdvars_::chansqline, check_chan_sqline(), check_kick(), channel_::ci, channel_::creation_time, csmodes, cumodes, debug, EVENT_JOIN_CHANNEL, EVENT_START, EVENT_STOP, find_byuid(), findchan(), findserver(), finduser(), ircd, is_oper(), is_sync(), join_user_update(), myStrGetToken(), channel_::name, channel_::c_userlist::next, botinfo_::nick, user_::nick, restore_topic(), s_OperServ, send_event(), servlist, ircdvars_::sjb64, ircdvars_::sjoinbanchar, ircdvars_::sjoinexchar, ircdvars_::sjoininvchar, sstrdup(), channel_::topic_sync, ircdvars_::ts6, channel_::users, and UseTS6.

Referenced by anope_event_fjoin(), anope_event_join(), and anope_event_sjoin().

void do_topic ( const char *  source,
int  ac,
char **  av 
)

Definition at line 1183 of file channels.c.

References alog(), base64dects(), check_topiclock(), channel_::ci, debug, EVENT_TOPIC_UPDATED, findchan(), ircd, chaninfo_::last_topic, chaninfo_::last_topic_setter, merge_args(), myStrGetToken(), record_topic(), send_event(), ircdvars_::sjb64, sstrdup(), strscpy(), channel_::topic, channel_::topic_setter, channel_::topic_sync, and channel_::topic_time.

Referenced by anope_event_ftopic(), anope_event_tburst(), and anope_event_topic().

Channel* findchan ( const char *  chan  ) 

Definition at line 359 of file channels.c.

References alog(), chanlist, debug, HASH, channel_::name, channel_::next, and stricmp().

Referenced by alog(), anope_event_bmask(), anope_event_tburst(), anope_event_topic(), check_kick(), delBan(), do_akick(), do_ban(), do_chankill(), do_clear(), do_clearmodes(), do_cmode(), do_cs_kick(), do_cs_topic(), do_deowner(), do_forbid(), do_invite(), do_join(), do_os_kick(), do_os_mode(), do_owner(), do_register(), do_sjoin(), do_suspend(), do_tban(), do_topic(), do_unban(), do_userlist(), do_util(), inspircd_cmd_mode(), memo_send(), my_cs_appendtopic(), my_cs_enforce(), record_topic(), and restore_topic().

Channel* firstchan ( void   ) 

Definition at line 392 of file channels.c.

References alog(), chanlist, debug, and channel_::name.

void get_channel_stats ( long *  nrec,
long *  memuse 
)

Definition at line 421 of file channels.c.

References channel_::bancount, channel_::bans, channel_::bansize, chanlist, ircdvars_::except, channel_::exceptcount, channel_::excepts, channel_::exceptsize, channel_::flood, ircdvars_::fmode, ircd, channel_::key, ircdvars_::Lmode, channel_::next, channel_::redirect, and channel_::topic.

Referenced by do_stats().

char* get_flood ( Channel chan  ) 

Definition at line 1779 of file channels.c.

References channel_::flood.

char* get_key ( Channel chan  ) 

Definition at line 1786 of file channels.c.

References channel_::key.

char* get_limit ( Channel chan  ) 

Definition at line 1793 of file channels.c.

References channel_::limit, and snprintf().

char* get_redirect ( Channel chan  ) 

Definition at line 1806 of file channels.c.

References channel_::redirect.

int is_on_chan ( Channel c,
User u 
)

Definition at line 487 of file channels.c.

References user_::chans, and user_::u_chanlist::next.

Referenced by bot_raw_kick(), bot_raw_mode(), chan_set_modes(), do_ban(), do_cs_kick(), do_deowner(), do_owner(), and do_util().

Channel* join_user_update ( User user,
Channel chan,
char *  name,
time_t  chants 
)

Definition at line 1813 of file channels.c.

References alog(), user_::u_chanlist::chan, chan_adduser2(), chan_create(), user_::chans, debug, channel_::name, user_::nick, user_::u_chanlist::prev, and scalloc().

Referenced by do_join(), and do_sjoin().

User* nc_on_chan ( Channel c,
NickCore nc 
)

Definition at line 503 of file channels.c.

References channel_::c_userlist::next, nick_recognized(), and channel_::users.

Channel* nextchan ( void   ) 

Definition at line 403 of file channels.c.

References alog(), chanlist, debug, channel_::name, and channel_::next.

void restore_unsynced_topics ( void   ) 

Definition at line 1920 of file channels.c.

References channel_::name, channel_::next, restore_topic(), and channel_::topic_sync.

Referenced by finish_sync().

void set_flood ( Channel chan,
char *  value 
)

Definition at line 1839 of file channels.c.

References alog(), debug, channel_::flood, channel_::name, and sstrdup().

void set_limit ( Channel chan,
char *  value 
)

Definition at line 1865 of file channels.c.

References alog(), debug, channel_::limit, and channel_::name.

void set_redirect ( Channel chan,
char *  value 
)

Definition at line 1876 of file channels.c.

References alog(), debug, channel_::name, channel_::redirect, and sstrdup().


Variable Documentation

Channel* chanlist[1024]

Definition at line 18 of file channels.c.


Generated on Sun Dec 30 09:26:55 2007 for Anope by  doxygen 1.5.1-20070107