summaryrefslogtreecommitdiff
path: root/src/fe-common/irc
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2000-06-04 14:52:47 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2000-06-04 14:52:47 +0000
commita7f5540cba46869fda6b3da42199bb85bd6dab8b (patch)
treee769eb1a127a6706865b470273eb561f6ae72d68 /src/fe-common/irc
parentee46dc71ab5fe607851bcc29f836d7f4a3d00a3e (diff)
downloadirssi-a7f5540cba46869fda6b3da42199bb85bd6dab8b.zip
/IRCNET command.
PARAM_FLAG_NOQUOTES flag for cmd_get_params() git-svn-id: http://svn.irssi.org/repos/irssi/trunk@290 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/fe-common/irc')
-rw-r--r--src/fe-common/irc/Makefile.am1
-rw-r--r--src/fe-common/irc/fe-channels.c10
-rw-r--r--src/fe-common/irc/fe-common-irc.c5
-rw-r--r--src/fe-common/irc/fe-irc-server.c22
-rw-r--r--src/fe-common/irc/module-formats.c6
-rw-r--r--src/fe-common/irc/module-formats.h6
6 files changed, 38 insertions, 12 deletions
diff --git a/src/fe-common/irc/Makefile.am b/src/fe-common/irc/Makefile.am
index 662caf9d..7c59e0d4 100644
--- a/src/fe-common/irc/Makefile.am
+++ b/src/fe-common/irc/Makefile.am
@@ -16,6 +16,7 @@ libfe_common_irc_la_SOURCES = \
fe-channels.c \
fe-irc-commands.c \
fe-irc-server.c \
+ fe-ircnet.c \
fe-ctcp.c \
fe-events.c \
fe-events-numeric.c \
diff --git a/src/fe-common/irc/fe-channels.c b/src/fe-common/irc/fe-channels.c
index 0d566fd7..1859ae7b 100644
--- a/src/fe-common/irc/fe-channels.c
+++ b/src/fe-common/irc/fe-channels.c
@@ -157,13 +157,13 @@ static void cmd_channel_list(void)
g_string_truncate(str, 0);
if (rec->autojoin)
- g_string_append(str, "autojoin ");
+ g_string_append(str, "autojoin, ");
if (rec->botmasks != NULL && *rec->botmasks != '\0')
- g_string_sprintfa(str, "bots: %s ", rec->botmasks);
+ g_string_sprintfa(str, "bots: %s, ", rec->botmasks);
if (rec->autosendcmd != NULL && *rec->autosendcmd != '\0')
- g_string_sprintfa(str, "botcmd: %s ", rec->autosendcmd);
+ g_string_sprintfa(str, "botcmd: %s, ", rec->autosendcmd);
- if (str->len > 0) g_string_truncate(str, str->len-1);
+ if (str->len > 1) g_string_truncate(str, str->len-1);
printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, IRCTXT_CHANSETUP_LINE,
rec->name, rec->ircnet == NULL ? "" : rec->ircnet,
rec->password == NULL ? "" : rec->password, str->str);
@@ -242,8 +242,8 @@ void fe_channels_init(void)
signal_add_last("server disconnected", (SIGNAL_FUNC) sig_disconnected);
command_bind("wjoin", NULL, (SIGNAL_FUNC) cmd_wjoin);
- command_bind("channel ", NULL, (SIGNAL_FUNC) cmd_channel_list_joined);
command_bind("channel", NULL, (SIGNAL_FUNC) cmd_channel);
+ command_bind("channel ", NULL, (SIGNAL_FUNC) cmd_channel_list_joined);
command_bind("channel add", NULL, (SIGNAL_FUNC) cmd_channel_add);
command_bind("channel remove", NULL, (SIGNAL_FUNC) cmd_channel_remove);
command_bind("channel list", NULL, (SIGNAL_FUNC) cmd_channel_list);
diff --git a/src/fe-common/irc/fe-common-irc.c b/src/fe-common/irc/fe-common-irc.c
index 63430a69..7125dab5 100644
--- a/src/fe-common/irc/fe-common-irc.c
+++ b/src/fe-common/irc/fe-common-irc.c
@@ -40,6 +40,9 @@ void fe_channels_deinit(void);
void fe_irc_commands_init(void);
void fe_irc_commands_deinit(void);
+void fe_ircnet_init(void);
+void fe_ircnet_deinit(void);
+
void fe_irc_server_init(void);
void fe_irc_server_deinit(void);
@@ -100,6 +103,7 @@ void fe_common_irc_init(void)
fe_channels_init();
fe_irc_commands_init();
+ fe_ircnet_init();
fe_irc_server_init();
fe_ctcp_init();
fe_events_init();
@@ -119,6 +123,7 @@ void fe_common_irc_deinit(void)
fe_channels_deinit();
fe_irc_commands_deinit();
+ fe_ircnet_deinit();
fe_irc_server_deinit();
fe_ctcp_deinit();
fe_events_deinit();
diff --git a/src/fe-common/irc/fe-irc-server.c b/src/fe-common/irc/fe-irc-server.c
index ee0978d7..24c662b4 100644
--- a/src/fe-common/irc/fe-irc-server.c
+++ b/src/fe-common/irc/fe-irc-server.c
@@ -101,14 +101,20 @@ static void server_add(const char *data)
if (*portarg != '\0') rec->port = atoi(portarg);
if (stristr(args, "-ircnet")) g_free_and_null(rec->ircnet);
if (*password != '\0') g_free_and_null(rec->password);
- if (stristr(args, "-host")) g_free_and_null(rec->own_host);
+ if (stristr(args, "-host")) {
+ g_free_and_null(rec->own_host);
+ rec->own_ip = NULL;
+ }
}
if (stristr(args, "-auto")) rec->autoconnect = TRUE;
if (stristr(args, "-noauto")) rec->autoconnect = FALSE;
if (*ircnet != '\0') rec->ircnet = g_strdup(ircnet);
if (*password != '\0' && strcmp(password, "-") != 0) rec->password = g_strdup(password);
- if (*host != '\0') rec->own_host = g_strdup(host);
+ if (*host != '\0') {
+ rec->own_host = g_strdup(host);
+ rec->own_ip = NULL;
+ }
if (*cmdspeed != '\0') rec->cmd_queue_speed = atoi(cmdspeed);
if (*cmdmax != '\0') rec->max_cmds_at_once = atoi(cmdmax);
@@ -151,15 +157,17 @@ static void server_list(const char *data)
g_string_truncate(str, 0);
if (rec->password != NULL)
- g_string_append(str, "(pass) ");
+ g_string_append(str, "(pass), ");
if (rec->autoconnect)
- g_string_append(str, "autoconnect ");
+ g_string_append(str, "autoconnect, ");
if (rec->max_cmds_at_once > 0)
- g_string_sprintfa(str, "cmdmax: %d ", rec->max_cmds_at_once);
+ g_string_sprintfa(str, "cmdmax: %d, ", rec->max_cmds_at_once);
if (rec->cmd_queue_speed > 0)
- g_string_sprintfa(str, "cmdspeed: %d ", rec->cmd_queue_speed);
+ g_string_sprintfa(str, "cmdspeed: %d, ", rec->cmd_queue_speed);
if (rec->own_host != NULL)
- g_string_sprintfa(str, "host: %s ", rec->own_host);
+ g_string_sprintfa(str, "host: %s, ", rec->own_host);
+
+ if (str->len > 1) g_string_truncate(str, str->len-2);
printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, IRCTXT_SETUPSERVER_LINE,
rec->address, rec->port,
rec->ircnet == NULL ? "" : rec->ircnet,
diff --git a/src/fe-common/irc/module-formats.c b/src/fe-common/irc/module-formats.c
index f09f50a4..c20089ff 100644
--- a/src/fe-common/irc/module-formats.c
+++ b/src/fe-common/irc/module-formats.c
@@ -47,6 +47,12 @@ FORMAT_REC fecommon_irc_formats[] = {
{ "netsplits_header", "Nick Channel Server Splitted server", 0 },
{ "netsplits_line", "$[9]0 $[10]1 $[20]2 $3", 4, { 0, 0, 0, 0 } },
{ "netsplits_footer", "", 0 },
+ { "ircnet_added", "Ircnet $0 saved", 1, { 0 } },
+ { "ircnet_removed", "Ircnet $0 removed", 1, { 0 } },
+ { "ircnet_not_found", "Ircnet $0 not found", 1, { 0 } },
+ { "ircnet_header", "Ircnets:", 0 },
+ { "ircnet_line", "$0: $1", 2, { 0, 0 } },
+ { "ircnet_footer", "", 0 },
/* ---- */
{ NULL, "Channels", 0 },
diff --git a/src/fe-common/irc/module-formats.h b/src/fe-common/irc/module-formats.h
index 56521f47..d4210461 100644
--- a/src/fe-common/irc/module-formats.h
+++ b/src/fe-common/irc/module-formats.h
@@ -25,6 +25,12 @@ enum {
IRCTXT_NETSPLITS_HEADER,
IRCTXT_NETSPLITS_LINE,
IRCTXT_NETSPLITS_FOOTER,
+ IRCTXT_IRCNET_ADDED,
+ IRCTXT_IRCNET_REMOVED,
+ IRCTXT_IRCNET_NOT_FOUND,
+ IRCTXT_IRCNET_HEADER,
+ IRCTXT_IRCNET_LINE,
+ IRCTXT_IRCNET_FOOTER,
IRCTXT_FILL_2,