コード例 #1
0
ファイル: bans.c プロジェクト: irssi/irssi
void bans_init(void)
{
        default_ban_type_str = NULL;
	settings_add_str("misc", "ban_type", "normal");

	command_bind_irc("ban", NULL, (SIGNAL_FUNC) cmd_ban);
	command_bind_irc("unban", NULL, (SIGNAL_FUNC) cmd_unban);
	command_set_options("ban", "normal user host domain +custom");
	command_set_options("unban", "first last");

        read_settings();
        signal_add("setup changed", (SIGNAL_FUNC) read_settings);
}
コード例 #2
0
ファイル: fe-irc-commands.c プロジェクト: Liaf/irssi
void fe_irc_commands_init(void)
{
	command_bind_irc_last("me", NULL, (SIGNAL_FUNC) cmd_me);
	command_bind_irc_last("action", NULL, (SIGNAL_FUNC) cmd_action);
	command_bind_irc("notice", NULL, (SIGNAL_FUNC) cmd_notice);
	command_bind_irc("ctcp", NULL, (SIGNAL_FUNC) cmd_ctcp);
	command_bind_irc("nctcp", NULL, (SIGNAL_FUNC) cmd_nctcp);
	command_bind_irc("wall", NULL, (SIGNAL_FUNC) cmd_wall);
	command_bind_irc("ban", NULL, (SIGNAL_FUNC) cmd_ban);
	command_bind_irc("ver", NULL, (SIGNAL_FUNC) cmd_ver);
	command_bind_irc("topic", NULL, (SIGNAL_FUNC) cmd_topic);
	command_bind_irc("ts", NULL, (SIGNAL_FUNC) cmd_ts);
	command_bind_irc("oper", NULL, (SIGNAL_FUNC) cmd_oper);
	command_bind_irc("sethost", NULL, (SIGNAL_FUNC) cmd_sethost);
}
コード例 #3
0
ファイル: modes.c プロジェクト: svn2github/irssi
void modes_init(void)
{
	settings_add_str("misc", "opermode", "");
	settings_add_int("misc", "max_wildcard_modes", 6);

	signal_add("event 221", (SIGNAL_FUNC) event_user_mode);
	signal_add("event 305", (SIGNAL_FUNC) event_unaway);
	signal_add("event 306", (SIGNAL_FUNC) event_away);
	signal_add("event 381", (SIGNAL_FUNC) event_oper);
	signal_add("event mode", (SIGNAL_FUNC) event_mode);
        signal_add("requested usermode change", (SIGNAL_FUNC) sig_req_usermode_change);

	command_bind_irc("op", NULL, (SIGNAL_FUNC) cmd_op);
	command_bind_irc("deop", NULL, (SIGNAL_FUNC) cmd_deop);
	command_bind_irc("voice", NULL, (SIGNAL_FUNC) cmd_voice);
	command_bind_irc("devoice", NULL, (SIGNAL_FUNC) cmd_devoice);
	command_bind_irc("mode", NULL, (SIGNAL_FUNC) cmd_mode);

	command_set_options("op", "yes");
}
コード例 #4
0
ファイル: channel-rejoin.c プロジェクト: svn2github/irssi
void channel_rejoin_init(void)
{
	rejoin_tag = g_timeout_add(REJOIN_TIMEOUT,
				   (GSourceFunc) sig_rejoin, NULL);

	command_bind_irc("rmrejoins", NULL, (SIGNAL_FUNC) cmd_rmrejoins);
	signal_add_first("event 407", (SIGNAL_FUNC) event_duplicate_channel);
	signal_add_first("event 437", (SIGNAL_FUNC) event_target_unavailable);
	signal_add_first("channel joined", (SIGNAL_FUNC) sig_remove_rejoin);
	signal_add_first("channel destroyed", (SIGNAL_FUNC) sig_remove_rejoin);
	signal_add("server disconnected", (SIGNAL_FUNC) sig_disconnected);
}
コード例 #5
0
ファイル: irc-commands.c プロジェクト: svn2github/irssi
void irc_commands_init(void)
{
	tmpstr = g_string_new(NULL);

	settings_add_str("misc", "part_message", "");
	settings_add_time("misc", "knockout_time", "5min");
	settings_add_str("misc", "wall_format", "[Wall/$0] $1-");
	settings_add_bool("misc", "kick_first_on_kickban", FALSE);
	settings_add_bool("misc", "auto_whowas", TRUE);

	knockout_tag = g_timeout_add(KNOCKOUT_TIMECHECK, (GSourceFunc) knockout_timeout, NULL);

	command_bind_irc("notice", NULL, (SIGNAL_FUNC) cmd_notice);
	command_bind_irc("ctcp", NULL, (SIGNAL_FUNC) cmd_ctcp);
	command_bind_irc("nctcp", NULL, (SIGNAL_FUNC) cmd_nctcp);
	command_bind_irc("part", NULL, (SIGNAL_FUNC) cmd_part);
	command_bind_irc("kick", NULL, (SIGNAL_FUNC) cmd_kick);
	command_bind_irc("topic", NULL, (SIGNAL_FUNC) cmd_topic);
	command_bind_irc("invite", NULL, (SIGNAL_FUNC) cmd_invite);
	command_bind_irc("list", NULL, (SIGNAL_FUNC) cmd_list);
	command_bind_irc("who", NULL, (SIGNAL_FUNC) cmd_who);
	command_bind_irc("names", NULL, (SIGNAL_FUNC) cmd_names);
	command_bind_irc("nick", NULL, (SIGNAL_FUNC) cmd_nick);
	/* SYNTAX: NOTE <command> [&<password>] [+|-<flags>] [<arguments>] */
	command_bind_irc("note", NULL, (SIGNAL_FUNC) command_self);
	command_bind_irc("whois", NULL, (SIGNAL_FUNC) cmd_whois);
	command_bind_irc("whowas", NULL, (SIGNAL_FUNC) cmd_whowas);
	command_bind_irc("ping", NULL, (SIGNAL_FUNC) cmd_ping);
	/* SYNTAX: KILL <nick> <reason> */
	command_bind_irc("kill", NULL, (SIGNAL_FUNC) command_2self);
	command_bind_irc("away", NULL, (SIGNAL_FUNC) cmd_away);
	/* SYNTAX: ISON <nicks> */
	command_bind_irc("ison", NULL, (SIGNAL_FUNC) command_1self);
	command_bind_irc("accept", NULL, (SIGNAL_FUNC) cmd_accept);
	/* SYNTAX: ADMIN [<server>|<nickname>] */
	command_bind_irc("admin", NULL, (SIGNAL_FUNC) command_self);
	/* SYNTAX: INFO [<server>] */
	command_bind_irc("info", NULL, (SIGNAL_FUNC) command_self);
    /* SYNTAX: KNOCK <channel> */
    command_bind_irc("knock", NULL, (SIGNAL_FUNC) command_self);
	/* SYNTAX: LINKS [[<server>] <mask>] */
	command_bind_irc("links", NULL, (SIGNAL_FUNC) command_self);
	/* SYNTAX: LUSERS [<server mask> [<remote server>]] */
	command_bind_irc("lusers", NULL, (SIGNAL_FUNC) command_self);
	/* SYNTAX: MAP */
	command_bind_irc("map", NULL, (SIGNAL_FUNC) command_self);
	/* SYNTAX: MOTD [<server>|<nick>] */
	command_bind_irc("motd", NULL, (SIGNAL_FUNC) command_self);
	/* SYNTAX: REHASH [<option>] */
	command_bind_irc("rehash", NULL, (SIGNAL_FUNC) command_self);
	/* SYNTAX: STATS <type> [<server>] */
	command_bind_irc("stats", NULL, (SIGNAL_FUNC) command_self);
	/* SYNTAX: TIME [<server>|<nick>] */
	command_bind_irc("time", NULL, (SIGNAL_FUNC) command_self);
	/* SYNTAX: TRACE [<server>|<nick>] */
	command_bind_irc("trace", NULL, (SIGNAL_FUNC) command_self);
	/* SYNTAX: VERSION [<server>|<nick>] */
	command_bind_irc("version", NULL, (SIGNAL_FUNC) command_self);
	/* SYNTAX: SERVLIST [<server mask>] */
	command_bind_irc("servlist", NULL, (SIGNAL_FUNC) command_self);
	/* SYNTAX: SILENCE [[+|-]<nick!user@host>]
	           SILENCE [<nick>] */
	command_bind_irc("silence", NULL, (SIGNAL_FUNC) command_self);
	command_bind_irc("unsilence", NULL, (SIGNAL_FUNC) cmd_unsilence);
	command_bind_irc("sconnect", NULL, (SIGNAL_FUNC) cmd_sconnect);
	/* SYNTAX: SQUERY <service> [<commands>] */
	command_bind_irc("squery", NULL, (SIGNAL_FUNC) command_2self);
	/* SYNTAX: DIE */
	command_bind_irc("die", NULL, (SIGNAL_FUNC) command_self);
	/* SYNTAX: HASH */
	command_bind_irc("hash", NULL, (SIGNAL_FUNC) command_self);
	command_bind_irc("oper", NULL, (SIGNAL_FUNC) cmd_oper);
	/* SYNTAX: RESTART */
	command_bind_irc("restart", NULL, (SIGNAL_FUNC) command_self);
	/* SYNTAX: RPING <server> */
	command_bind_irc("rping", NULL, (SIGNAL_FUNC) command_self);
	/* SYNTAX: SQUIT <server>|<mask> <reason> */
	command_bind_irc("squit", NULL, (SIGNAL_FUNC) command_2self);
	/* SYNTAX: UPING <server> */
	command_bind_irc("uping", NULL, (SIGNAL_FUNC) command_self);
	/* SYNTAX: USERHOST <nicks> */
	command_bind_irc("userhost", NULL, (SIGNAL_FUNC) command_self);
	command_bind_irc("quote", NULL, (SIGNAL_FUNC) cmd_quote);
	command_bind_irc("rawquote", NULL, (SIGNAL_FUNC) cmd_rawquote);
	command_bind_irc("wall", NULL, (SIGNAL_FUNC) cmd_wall);
	command_bind_irc("wallchops", NULL, (SIGNAL_FUNC) cmd_wallchops);
	command_bind_irc("wait", NULL, (SIGNAL_FUNC) cmd_wait);
	/* SYNTAX: WALLOPS <message> */
	command_bind_irc("wallops", NULL, (SIGNAL_FUNC) command_1self);
	command_bind_irc("kickban", NULL, (SIGNAL_FUNC) cmd_kickban);
	command_bind_irc("knockout", NULL, (SIGNAL_FUNC) cmd_knockout);
	command_bind_irc("server purge", NULL, (SIGNAL_FUNC) cmd_server_purge);

	signal_add("channel destroyed", (SIGNAL_FUNC) sig_channel_destroyed);
	signal_add("server disconnected", (SIGNAL_FUNC) sig_server_disconnected);
	signal_add("whois try whowas", (SIGNAL_FUNC) sig_whois_try_whowas);
	signal_add("whois event", (SIGNAL_FUNC) event_whois);
	signal_add("whois end", (SIGNAL_FUNC) event_end_of_whois);
	signal_add("whowas event", (SIGNAL_FUNC) event_whowas);

	command_set_options("connect", "+ircnet");
	command_set_options("topic", "delete");
	command_set_options("list", "yes");
	command_set_options("away", "one all");
	command_set_options("whois", "yes");
}