mirror of
https://github.com/irssi/irssi.git
synced 2026-08-10 20:33:46 +02:00
/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
This commit is contained in:
parent
ee46dc71ab
commit
a7f5540cba
15 changed files with 173 additions and 68 deletions
|
|
@ -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 \
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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 },
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue