diff options
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/levels.c | 1 | ||||
-rw-r--r-- | src/core/levels.h | 19 | ||||
-rw-r--r-- | src/core/server.c | 10 | ||||
-rw-r--r-- | src/core/settings.c | 21 |
4 files changed, 32 insertions, 19 deletions
diff --git a/src/core/levels.c b/src/core/levels.c index 7e55d738..9682dcdd 100644 --- a/src/core/levels.c +++ b/src/core/levels.c @@ -36,7 +36,6 @@ static char *levels[] = "KICKS", "MODES", "TOPICS", - "WALLS", "WALLOPS", "INVITES", "NICKS", diff --git a/src/core/levels.h b/src/core/levels.h index f3a54507..ccaf6daa 100644 --- a/src/core/levels.h +++ b/src/core/levels.h @@ -20,17 +20,16 @@ #define MSGLEVEL_KICKS 0x0000400 #define MSGLEVEL_MODES 0x0000800 #define MSGLEVEL_TOPICS 0x0001000 -#define MSGLEVEL_WALLS 0x0002000 -#define MSGLEVEL_WALLOPS 0x0004000 -#define MSGLEVEL_INVITES 0x0008000 -#define MSGLEVEL_NICKS 0x0010000 -#define MSGLEVEL_DCC 0x0020000 -#define MSGLEVEL_CLIENTNOTICE 0x0040000 -#define MSGLEVEL_CLIENTCRAP 0x0080000 -#define MSGLEVEL_CLIENTERROR 0x0100000 -#define MSGLEVEL_HILIGHT 0x0200000 +#define MSGLEVEL_WALLOPS 0x0002000 +#define MSGLEVEL_INVITES 0x0004000 +#define MSGLEVEL_NICKS 0x0008000 +#define MSGLEVEL_DCC 0x0010000 +#define MSGLEVEL_CLIENTNOTICE 0x0020000 +#define MSGLEVEL_CLIENTCRAP 0x0040000 +#define MSGLEVEL_CLIENTERROR 0x0080000 +#define MSGLEVEL_HILIGHT 0x0100000 -#define MSGLEVEL_ALL 0x03fffff +#define MSGLEVEL_ALL 0x01fffff #define MSGLEVEL_NOHILIGHT 0x1000000 /* Don't try to hilight words in this message */ #define MSGLEVEL_NO_ACT 0x2000000 /* Don't trigger channel activity */ diff --git a/src/core/server.c b/src/core/server.c index dcfefc5a..a600e74a 100644 --- a/src/core/server.c +++ b/src/core/server.c @@ -60,7 +60,9 @@ static char *server_create_address_tag(const char *address) const char *start, *end; /* try to generate a reasonable server tag */ - if (g_strncasecmp(address, "irc", 3) == 0 || + if (strchr(address, '.') == NULL) { + start = end = NULL; + } else if (g_strncasecmp(address, "irc", 3) == 0 || g_strncasecmp(address, "chat", 4) == 0) { /* irc-2.cs.hut.fi -> hut, chat.bt.net -> bt */ end = strrchr(address, '.'); @@ -224,14 +226,14 @@ SERVER_REC *server_find_tag(const char *tag) for (tmp = servers; tmp != NULL; tmp = tmp->next) { SERVER_REC *server = tmp->data; - if (strcmp(server->tag, tag) == 0) + if (g_strcasecmp(server->tag, tag) == 0) return server; } for (tmp = lookup_servers; tmp != NULL; tmp = tmp->next) { SERVER_REC *server = tmp->data; - if (strcmp(server->tag, tag) == 0) + if (g_strcasecmp(server->tag, tag) == 0) return server; } @@ -249,7 +251,7 @@ SERVER_REC *server_find_ircnet(const char *ircnet) SERVER_REC *server = tmp->data; if (server->connrec->ircnet != NULL && - strcmp(server->connrec->ircnet, ircnet) == 0) return server; + g_strcasecmp(server->connrec->ircnet, ircnet) == 0) return server; } return NULL; diff --git a/src/core/settings.c b/src/core/settings.c index 5db3c790..a7e27a63 100644 --- a/src/core/settings.c +++ b/src/core/settings.c @@ -258,7 +258,11 @@ static void init_configfile(void) if (stat(str, &statbuf) != 0) { /* ~/.irssi not found, create it. */ if (mkdir(str, 0700) != 0) - g_error("Couldn't create %s/.irssi directory", g_get_home_dir()); + g_error(_("Couldn't create %s/.irssi directory"), g_get_home_dir()); + } else { + if (!S_ISDIR(statbuf.st_mode)) { + g_error(_("%s/.irssi is not a directory.\nYou should remove it with command: rm ~/.irssi"), g_get_home_dir()); + } } g_free(str); @@ -266,7 +270,7 @@ static void init_configfile(void) /* any errors? */ if (config_last_error(mainconfig) != NULL) { - last_error_msg = g_strdup_printf("Ignored errors in configuration file:\n%s", + last_error_msg = g_strdup_printf(_("Ignored errors in configuration file:\n%s"), config_last_error(mainconfig)); signal_add("irssi init finished", (SIGNAL_FUNC) sig_print_config_error); } @@ -291,7 +295,7 @@ static void cmd_rehash(const char *data) if (config_last_error(tempconfig) != NULL) { /* error */ - str = g_strdup_printf("Errors in configuration file:\n%s", + str = g_strdup_printf(_("Errors in configuration file:\n%s"), config_last_error(tempconfig)); signal_emit("gui dialog", 2, "error", str); g_free(str); @@ -308,7 +312,16 @@ static void cmd_rehash(const char *data) static void cmd_save(const char *data) { - config_write(mainconfig, *data == '\0' ? NULL : data, 0660); + char *str; + + if (config_write(mainconfig, *data == '\0' ? NULL : data, 0660) == 0) + return; + + /* error */ + str = g_strdup_printf(_("Couldn't save configuration file: %s"), + config_last_error(mainconfig)); + signal_emit("gui dialog", 2, "error", str); + g_free(str); } void settings_init(void) |