summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2000-06-04 13:24:53 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2000-06-04 13:24:53 +0000
commitee46dc71ab5fe607851bcc29f836d7f4a3d00a3e (patch)
tree67d74226a08ba56ab0717b8e3dedcc21a11e9649 /src
parent086e433bc605ee21ed8d084ea1697fd767b3c946 (diff)
downloadirssi-ee46dc71ab5fe607851bcc29f836d7f4a3d00a3e.zip
Updated /SERVER, /CHANNEL and /IGNORE in manual.
/CHANNEL ADD works now better when modifying existing channel. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@289 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src')
-rw-r--r--src/fe-common/irc/fe-channels.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/fe-common/irc/fe-channels.c b/src/fe-common/irc/fe-channels.c
index 272f954c..0d566fd7 100644
--- a/src/fe-common/irc/fe-channels.c
+++ b/src/fe-common/irc/fe-channels.c
@@ -163,7 +163,7 @@ static void cmd_channel_list(void)
if (rec->autosendcmd != NULL && *rec->autosendcmd != '\0')
g_string_sprintfa(str, "botcmd: %s ", rec->autosendcmd);
- g_string_truncate(str, str->len-1);
+ if (str->len > 0) 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);
@@ -199,14 +199,15 @@ static void cmd_channel_add(const char *data)
rec->name = g_strdup(channel);
rec->ircnet = g_strdup(ircnet);
} else {
- g_free_not_null(rec->botmasks);
- g_free_not_null(rec->autosendcmd);
- g_free_not_null(rec->password);
+ if (stristr(args, "-bots")) g_free_and_null(rec->botmasks);
+ if (stristr(args, "-botcmd")) g_free_and_null(rec->autosendcmd);
+ if (*password != '\0') g_free_and_null(rec->password);
}
- rec->autojoin = stristr(args, "-auto") != NULL;
- rec->botmasks = *botarg == '\0' ? NULL : g_strdup(botarg);
- rec->autosendcmd = *botcmdarg == '\0' ? NULL : g_strdup(botcmdarg);
- rec->password = *password == '\0' ? NULL : g_strdup(password);
+ if (stristr(args, "-auto")) rec->autojoin = TRUE;
+ if (stristr(args, "-noauto")) rec->autojoin = FALSE;
+ if (*botarg != '\0') rec->botmasks = g_strdup(botarg);
+ if (*botcmdarg != '\0') rec->autosendcmd = g_strdup(botcmdarg);
+ if (*password != '\0' && strcmp(password, "-") != 0) rec->password = g_strdup(password);
channels_setup_create(rec);
printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, IRCTXT_CHANSETUP_ADDED, channel, ircnet);