void notifylist_ison_init(void) { settings_add_time("misc", "notify_check_time", DEFAULT_NOTIFY_CHECK_TIME); settings_add_time("misc", "notify_whois_time", DEFAULT_NOTIFY_WHOIS_TIME); notify_tag = -1; read_settings(); signal_add("notifylist event", (SIGNAL_FUNC) event_ison); signal_add("setup changed", (SIGNAL_FUNC) read_settings); }
void fe_queries_init(void) { settings_add_level("lookandfeel", "autocreate_query_level", "MSGS DCCMSGS"); settings_add_bool("lookandfeel", "autocreate_own_query", TRUE); settings_add_time("lookandfeel", "autoclose_query", "0"); queryclose_tag = -1; read_settings(); signal_add("query created", (SIGNAL_FUNC) signal_query_created); signal_add("query destroyed", (SIGNAL_FUNC) signal_query_destroyed); signal_add("query server changed", (SIGNAL_FUNC) signal_query_server_changed); signal_add("query nick changed", (SIGNAL_FUNC) signal_query_nick_changed); signal_add("window item server changed", (SIGNAL_FUNC) signal_window_item_server_changed); signal_add("server connected", (SIGNAL_FUNC) sig_server_connected); signal_add("window changed", (SIGNAL_FUNC) sig_window_changed); signal_add_first("message private", (SIGNAL_FUNC) sig_message_private); signal_add("setup changed", (SIGNAL_FUNC) read_settings); command_bind("query", NULL, (SIGNAL_FUNC) cmd_query); command_bind("unquery", NULL, (SIGNAL_FUNC) cmd_unquery); command_bind("window server", NULL, (SIGNAL_FUNC) cmd_window_server); command_set_options("query", "window"); }
void irc_dcc_init(void) { dcc_conns = NULL; dcc_timeouttag = g_timeout_add(1000, (GSourceFunc) dcc_timeout_func, NULL); settings_add_str("dcc", "dcc_port", "0"); settings_add_time("dcc", "dcc_timeout", "5min"); settings_add_str("dcc", "dcc_own_ip", ""); signal_add("event connected", (SIGNAL_FUNC) sig_connected); signal_add("server disconnected", (SIGNAL_FUNC) sig_server_disconnected); signal_add("server nick changed", (SIGNAL_FUNC) sig_server_nick_changed); signal_add("ctcp msg", (SIGNAL_FUNC) ctcp_msg); signal_add("ctcp reply", (SIGNAL_FUNC) ctcp_reply); signal_add("ctcp msg dcc", (SIGNAL_FUNC) ctcp_msg_dcc); signal_add("ctcp reply dcc", (SIGNAL_FUNC) ctcp_reply_dcc); signal_add("ctcp reply dcc reject", (SIGNAL_FUNC) ctcp_reply_dcc_reject); signal_add("event 401", (SIGNAL_FUNC) event_no_such_nick); command_bind("dcc", NULL, (SIGNAL_FUNC) cmd_dcc); command_bind("dcc close", NULL, (SIGNAL_FUNC) cmd_dcc_close); dcc_chat_init(); dcc_get_init(); dcc_send_init(); dcc_resume_init(); dcc_autoget_init(); dcc_server_init(); settings_check(); module_register("dcc", "irc"); }
void irc_servers_init(void) { settings_add_str("misc", "usermode", DEFAULT_USER_MODE); settings_add_time("flood", "cmd_queue_speed", DEFAULT_CMD_QUEUE_SPEED); settings_add_int("flood", "cmds_max_at_once", DEFAULT_CMDS_MAX_AT_ONCE); cmd_tag = -1; signal_add_first("server connected", (SIGNAL_FUNC) sig_connected); signal_add_last("server disconnected", (SIGNAL_FUNC) sig_disconnected); signal_add_last("server quit", (SIGNAL_FUNC) sig_server_quit); signal_add("event 001", (SIGNAL_FUNC) event_connected); signal_add("event 004", (SIGNAL_FUNC) event_server_info); signal_add("event 005", (SIGNAL_FUNC) event_isupport); signal_add("event 375", (SIGNAL_FUNC) event_motd); signal_add_last("event 376", (SIGNAL_FUNC) event_end_of_motd); signal_add_last("event 422", (SIGNAL_FUNC) event_end_of_motd); /* no motd */ signal_add("event 254", (SIGNAL_FUNC) event_channels_formed); signal_add("event 396", (SIGNAL_FUNC) event_hosthidden); signal_add("event 465", (SIGNAL_FUNC) event_server_banned); signal_add("event error", (SIGNAL_FUNC) event_error); signal_add("event ping", (SIGNAL_FUNC) event_ping); signal_add("event empty", (SIGNAL_FUNC) event_empty); irc_servers_setup_init(); irc_servers_reconnect_init(); servers_redirect_init(); servers_idle_init(); }
void servers_reconnect_init(void) { settings_add_time("server", "server_reconnect_time", "5min"); settings_add_time("server", "server_connect_timeout", "5min"); reconnects = NULL; last_reconnect_tag = 0; reconnect_timeout_tag = g_timeout_add(1000, (GSourceFunc) server_reconnect_timeout, NULL); read_settings(); signal_add("server connect failed", (SIGNAL_FUNC) sig_reconnect); signal_add("server disconnected", (SIGNAL_FUNC) sig_reconnect); signal_add("event connected", (SIGNAL_FUNC) sig_connected); signal_add("chat protocol deinit", (SIGNAL_FUNC) sig_chat_protocol_deinit); signal_add("setup changed", (SIGNAL_FUNC) read_settings); command_bind("rmreconns", NULL, (SIGNAL_FUNC) cmd_rmreconns); command_bind("reconnect", NULL, (SIGNAL_FUNC) cmd_reconnect); command_bind_first("disconnect", NULL, (SIGNAL_FUNC) cmd_disconnect); }
void statusbar_items_init(void) { settings_add_time("misc", "lag_min_show", "1sec"); settings_add_str("lookandfeel", "actlist_sort", "refnum"); settings_add_bool("lookandfeel", "actlist_names", FALSE); settings_add_bool("lookandfeel", "actlist_prefer_window_name", FALSE); statusbar_item_register("window", NULL, item_window_active); statusbar_item_register("window_empty", NULL, item_window_empty); statusbar_item_register("prompt", NULL, item_window_active); statusbar_item_register("prompt_empty", NULL, item_window_empty); statusbar_item_register("topic", NULL, item_window_active); statusbar_item_register("topic_empty", NULL, item_window_empty); statusbar_item_register("lag", NULL, item_lag); statusbar_item_register("act", NULL, item_act); statusbar_item_register("more", NULL, item_more); statusbar_item_register("input", NULL, item_input); /* activity */ activity_list = NULL; signal_add("window activity", (SIGNAL_FUNC) sig_statusbar_activity_hilight); signal_add("window destroyed", (SIGNAL_FUNC) sig_statusbar_activity_window_destroyed); signal_add("window refnum changed", (SIGNAL_FUNC) sig_statusbar_activity_updated); /* more */ more_visible = NULL; signal_add("gui page scrolled", (SIGNAL_FUNC) sig_statusbar_more_updated); signal_add("window changed", (SIGNAL_FUNC) sig_statusbar_more_updated); signal_add_last("gui print text finished", (SIGNAL_FUNC) sig_statusbar_more_updated); signal_add_last("command clear", (SIGNAL_FUNC) sig_statusbar_more_updated); signal_add_last("command scrollback", (SIGNAL_FUNC) sig_statusbar_more_updated); /* lag */ last_lag = 0; last_lag_unknown = FALSE; signal_add("server lag", (SIGNAL_FUNC) sig_server_lag_updated); signal_add("window changed", (SIGNAL_FUNC) lag_check_update); signal_add("window server changed", (SIGNAL_FUNC) lag_check_update); lag_timeout_tag = g_timeout_add(5000, (GSourceFunc) sig_lag_timeout, NULL); /* input */ input_entries = g_hash_table_new((GHashFunc) g_str_hash, (GCompareFunc) g_str_equal); read_settings(); signal_add_last("setup changed", (SIGNAL_FUNC) read_settings); }
void gui_printtext_init(void) { next_xpos = next_ypos = -1; default_indent_func = NULL; indent_functions = g_hash_table_new((GHashFunc) g_str_hash, (GCompareFunc) g_str_equal); settings_add_int("history", "scrollback_lines", 500); settings_add_time("history", "scrollback_time", "1day"); settings_add_int("history", "scrollback_burst_remove", 10); signal_add("gui print text", (SIGNAL_FUNC) sig_gui_print_text); signal_add("gui print text finished", (SIGNAL_FUNC) sig_gui_printtext_finished); signal_add("setup changed", (SIGNAL_FUNC) read_settings); read_settings(); }
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"); }
void fe_common_core_init(void) { const char *str; settings_add_bool("lookandfeel", "timestamps", TRUE); settings_add_level("lookandfeel", "timestamp_level", "ALL"); settings_add_time("lookandfeel", "timestamp_timeout", "0"); settings_add_bool("lookandfeel", "bell_beeps", FALSE); settings_add_level("lookandfeel", "beep_msg_level", ""); settings_add_bool("lookandfeel", "beep_when_window_active", TRUE); settings_add_bool("lookandfeel", "beep_when_away", TRUE); settings_add_bool("lookandfeel", "hide_text_style", FALSE); settings_add_bool("lookandfeel", "hide_colors", FALSE); settings_add_bool("lookandfeel", "hide_server_tags", FALSE); settings_add_bool("lookandfeel", "use_status_window", TRUE); settings_add_bool("lookandfeel", "use_msgs_window", FALSE); g_get_charset(&str); settings_add_str("lookandfeel", "term_charset", str); themes_init(); theme_register(fecommon_core_formats); command_history_init(); completion_init(); keyboard_init(); printtext_init(); formats_init(); #ifndef WIN32 fe_exec_init(); #endif fe_expandos_init(); fe_help_init(); fe_ignore_init(); fe_log_init(); fe_modules_init(); fe_server_init(); fe_settings_init(); windows_init(); window_activity_init(); window_commands_init(); window_items_init(); windows_layout_init(); fe_core_commands_init(); fe_channels_init(); fe_queries_init(); fe_messages_init(); hilight_text_init(); fe_ignore_messages_init(); fe_recode_init(); settings_check(); signal_add_first("server connected", (SIGNAL_FUNC) sig_connected); signal_add_last("server disconnected", (SIGNAL_FUNC) sig_disconnected); signal_add_first("channel created", (SIGNAL_FUNC) sig_channel_created); signal_add_last("channel destroyed", (SIGNAL_FUNC) sig_channel_destroyed); module_register("core", "fe"); }
void fe_common_core_init(void) { static struct poptOption version_options[] = { { NULL, '\0', POPT_ARG_CALLBACK, (void *)&print_version, '\0', NULL }, { "version", 'v', POPT_ARG_NONE, NULL, 0, "Display irssi version" }, { NULL, '\0', 0, NULL } }; static struct poptOption options[] = { { NULL, '\0', POPT_ARG_INCLUDE_TABLE, version_options, 0, NULL, NULL }, POPT_AUTOHELP { "connect", 'c', POPT_ARG_STRING, &autocon_server, 0, "Automatically connect to server/ircnet", "SERVER" }, { "password", 'w', POPT_ARG_STRING, &autocon_password, 0, "Autoconnect password", "PASSWORD" }, { "port", 'p', POPT_ARG_INT, &autocon_port, 0, "Autoconnect port", "PORT" }, { "noconnect", '!', POPT_ARG_NONE, &no_autoconnect, 0, "Disable autoconnecting", NULL }, { "nick", 'n', POPT_ARG_STRING, &cmdline_nick, 0, "Specify nick to use", NULL }, { "hostname", 'h', POPT_ARG_STRING, &cmdline_hostname, 0, "Specify host name to use", NULL }, { NULL, '\0', 0, NULL } }; autocon_server = NULL; autocon_password = NULL; autocon_port = 0; no_autoconnect = FALSE; cmdline_nick = NULL; cmdline_hostname = NULL; args_register(options); settings_add_bool("lookandfeel", "timestamps", TRUE); settings_add_level("lookandfeel", "timestamp_level", "ALL"); settings_add_time("lookandfeel", "timestamp_timeout", 0); settings_add_bool("lookandfeel", "bell_beeps", FALSE); settings_add_level("lookandfeel", "beep_msg_level", ""); settings_add_bool("lookandfeel", "beep_when_window_active", TRUE); settings_add_bool("lookandfeel", "beep_when_away", TRUE); settings_add_bool("lookandfeel", "hide_text_style", FALSE); settings_add_bool("lookandfeel", "hide_colors", FALSE); settings_add_bool("lookandfeel", "hide_server_tags", FALSE); settings_add_bool("lookandfeel", "use_status_window", TRUE); settings_add_bool("lookandfeel", "use_msgs_window", FALSE); themes_init(); theme_register(fecommon_core_formats); command_history_init(); completion_init(); keyboard_init(); printtext_init(); formats_init(); #ifndef WIN32 fe_exec_init(); #endif fe_expandos_init(); fe_help_init(); fe_ignore_init(); fe_log_init(); fe_modules_init(); fe_server_init(); fe_settings_init(); translation_init(); windows_init(); window_activity_init(); window_commands_init(); window_items_init(); windows_layout_init(); fe_core_commands_init(); fe_channels_init(); fe_queries_init(); fe_messages_init(); hilight_text_init(); fe_ignore_messages_init(); settings_check(); signal_add_first("server connected", (SIGNAL_FUNC) sig_connected); signal_add_last("server disconnected", (SIGNAL_FUNC) sig_disconnected); signal_add_first("channel created", (SIGNAL_FUNC) sig_channel_created); signal_add_last("channel destroyed", (SIGNAL_FUNC) sig_channel_destroyed); module_register("core", "fe"); }