1
0
mirror of https://github.com/irssi/irssi.git synced 2024-12-04 14:46:39 -05:00

In core/module-formats.h: IRCTXT_ -> TXT_

Added "message irc ctcp" signal to print CTCPs


git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1094 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2001-01-07 19:42:59 +00:00 committed by cras
parent e46e2b5e09
commit 1de2aade40
22 changed files with 318 additions and 302 deletions

View File

@ -101,7 +101,7 @@ static void signal_window_item_changed(WINDOW_REC *window, WI_ITEM_REC *item)
if (g_slist_length(window->items) > 1 && IS_CHANNEL(item)) { if (g_slist_length(window->items) > 1 && IS_CHANNEL(item)) {
printformat(item->server, item->name, MSGLEVEL_CLIENTNOTICE, printformat(item->server, item->name, MSGLEVEL_CLIENTNOTICE,
IRCTXT_TALKING_IN, item->name); TXT_TALKING_IN, item->name);
signal_stop(); signal_stop();
} }
} }
@ -161,17 +161,17 @@ static void cmd_channel_list_joined(void)
GSList *nicklist, *tmp, *ntmp; GSList *nicklist, *tmp, *ntmp;
if (channels == NULL) { if (channels == NULL) {
printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, IRCTXT_NOT_IN_CHANNELS); printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, TXT_NOT_IN_CHANNELS);
return; return;
} }
/* print active channel */ /* print active channel */
channel = CHANNEL(active_win->active); channel = CHANNEL(active_win->active);
if (channel != NULL) if (channel != NULL)
printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, IRCTXT_CURRENT_CHANNEL, channel->name); printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, TXT_CURRENT_CHANNEL, channel->name);
/* print list of all channels, their modes, server tags and nicks */ /* print list of all channels, their modes, server tags and nicks */
printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, IRCTXT_CHANLIST_HEADER); printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, TXT_CHANLIST_HEADER);
for (tmp = channels; tmp != NULL; tmp = tmp->next) { for (tmp = channels; tmp != NULL; tmp = tmp->next) {
channel = tmp->data; channel = tmp->data;
@ -184,7 +184,7 @@ static void cmd_channel_list_joined(void)
} }
if (nicks->len > 1) g_string_truncate(nicks, nicks->len-1); if (nicks->len > 1) g_string_truncate(nicks, nicks->len-1);
printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, IRCTXT_CHANLIST_LINE, printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, TXT_CHANLIST_LINE,
channel->name, channel->mode, channel->server->tag, nicks->str); channel->name, channel->mode, channel->server->tag, nicks->str);
g_slist_free(nicklist); g_slist_free(nicklist);
@ -199,7 +199,7 @@ static void cmd_channel_list(void)
GSList *tmp; GSList *tmp;
str = g_string_new(NULL); str = g_string_new(NULL);
printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, IRCTXT_CHANSETUP_HEADER); printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, TXT_CHANSETUP_HEADER);
for (tmp = setupchannels; tmp != NULL; tmp = tmp->next) { for (tmp = setupchannels; tmp != NULL; tmp = tmp->next) {
CHANNEL_SETUP_REC *rec = tmp->data; CHANNEL_SETUP_REC *rec = tmp->data;
@ -212,12 +212,12 @@ static void cmd_channel_list(void)
g_string_sprintfa(str, "botcmd: %s, ", rec->autosendcmd); g_string_sprintfa(str, "botcmd: %s, ", rec->autosendcmd);
if (str->len > 2) g_string_truncate(str, str->len-2); if (str->len > 2) g_string_truncate(str, str->len-2);
printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, IRCTXT_CHANSETUP_LINE, printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, TXT_CHANSETUP_LINE,
rec->name, rec->chatnet == NULL ? "" : rec->chatnet, rec->name, rec->chatnet == NULL ? "" : rec->chatnet,
rec->password == NULL ? "" : rec->password, str->str); rec->password == NULL ? "" : rec->password, str->str);
} }
g_string_free(str, TRUE); g_string_free(str, TRUE);
printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, IRCTXT_CHANSETUP_FOOTER); printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, TXT_CHANSETUP_FOOTER);
} }
static void cmd_channel(const char *data, SERVER_REC *server, WI_ITEM_REC *item) static void cmd_channel(const char *data, SERVER_REC *server, WI_ITEM_REC *item)
@ -262,7 +262,7 @@ static void cmd_channel_add(const char *data)
if (botcmdarg != NULL && *botcmdarg != '\0') rec->autosendcmd = g_strdup(botcmdarg); if (botcmdarg != NULL && *botcmdarg != '\0') rec->autosendcmd = g_strdup(botcmdarg);
if (*password != '\0' && strcmp(password, "-") != 0) rec->password = g_strdup(password); if (*password != '\0' && strcmp(password, "-") != 0) rec->password = g_strdup(password);
channels_setup_create(rec); channels_setup_create(rec);
printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, IRCTXT_CHANSETUP_ADDED, channel, chatnet); printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, TXT_CHANSETUP_ADDED, channel, chatnet);
cmd_params_free(free_arg); cmd_params_free(free_arg);
} }
@ -281,9 +281,9 @@ static void cmd_channel_remove(const char *data)
rec = channels_setup_find(channel, chatnet); rec = channels_setup_find(channel, chatnet);
if (rec == NULL) if (rec == NULL)
printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, IRCTXT_CHANSETUP_NOT_FOUND, channel, chatnet); printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, TXT_CHANSETUP_NOT_FOUND, channel, chatnet);
else { else {
printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, IRCTXT_CHANSETUP_REMOVED, channel, chatnet); printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, TXT_CHANSETUP_REMOVED, channel, chatnet);
channels_setup_destroy(rec); channels_setup_destroy(rec);
} }
cmd_params_free(free_arg); cmd_params_free(free_arg);

View File

@ -34,18 +34,18 @@
#define PASTE_CHECK_SPEED 200 /* 0.2 sec */ #define PASTE_CHECK_SPEED 200 /* 0.2 sec */
static int ret_texts[] = { static int ret_texts[] = {
IRCTXT_OPTION_UNKNOWN, TXT_OPTION_UNKNOWN,
IRCTXT_OPTION_AMBIGUOUS, TXT_OPTION_AMBIGUOUS,
IRCTXT_OPTION_MISSING_ARG, TXT_OPTION_MISSING_ARG,
IRCTXT_COMMAND_UNKNOWN, TXT_COMMAND_UNKNOWN,
IRCTXT_COMMAND_AMBIGUOUS, TXT_COMMAND_AMBIGUOUS,
-1, -1,
IRCTXT_NOT_ENOUGH_PARAMS, TXT_NOT_ENOUGH_PARAMS,
IRCTXT_NOT_CONNECTED, TXT_NOT_CONNECTED,
IRCTXT_NOT_JOINED, TXT_NOT_JOINED,
IRCTXT_CHAN_NOT_FOUND, TXT_CHAN_NOT_FOUND,
IRCTXT_CHAN_NOT_SYNCED, TXT_CHAN_NOT_SYNCED,
IRCTXT_NOT_GOOD_IDEA TXT_NOT_GOOD_IDEA
}; };
/* keep the whole command line here temporarily. we need it in /* keep the whole command line here temporarily. we need it in

View File

@ -119,7 +119,7 @@ static void ignore_print(int index, IGNORE_REC *rec)
if (options->len > 1) g_string_truncate(options, options->len-1); if (options->len > 1) g_string_truncate(options, options->len-1);
printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP,
IRCTXT_IGNORE_LINE, index, TXT_IGNORE_LINE, index,
key != NULL ? key : "", key != NULL ? key : "",
levels != NULL ? levels : "", options->str); levels != NULL ? levels : "", options->str);
g_string_free(options, TRUE); g_string_free(options, TRUE);
@ -138,14 +138,14 @@ static void cmd_ignore_show(void)
GSList *tmp; GSList *tmp;
int index; int index;
printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, IRCTXT_IGNORE_HEADER); printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, TXT_IGNORE_HEADER);
index = 1; index = 1;
for (tmp = ignores; tmp != NULL; tmp = tmp->next, index++) { for (tmp = ignores; tmp != NULL; tmp = tmp->next, index++) {
IGNORE_REC *rec = tmp->data; IGNORE_REC *rec = tmp->data;
ignore_print(index, rec); ignore_print(index, rec);
} }
printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, IRCTXT_IGNORE_FOOTER); printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, TXT_IGNORE_FOOTER);
} }
/* SYNTAX: IGNORE [-regexp | -word] [-pattern <pattern>] [-except] [-replies] /* SYNTAX: IGNORE [-regexp | -word] [-pattern <pattern>] [-except] [-replies]
@ -212,12 +212,12 @@ static void cmd_ignore(const char *data)
rec->time = timestr == NULL ? 0 : atoi(timestr); rec->time = timestr == NULL ? 0 : atoi(timestr);
if (rec->level == 0 && rec->except_level == 0) { if (rec->level == 0 && rec->except_level == 0) {
printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, IRCTXT_UNIGNORED, printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, TXT_UNIGNORED,
rec->mask == NULL ? "" : rec->mask); rec->mask == NULL ? "" : rec->mask);
} else { } else {
key = ignore_get_key(rec); key = ignore_get_key(rec);
levels = ignore_get_levels(rec->level, rec->except_level); levels = ignore_get_levels(rec->level, rec->except_level);
printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, IRCTXT_IGNORED, key, levels); printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, TXT_IGNORED, key, levels);
g_free(key); g_free(key);
g_free(levels); g_free(levels);
} }
@ -238,7 +238,7 @@ static void fe_unignore(IGNORE_REC *rec)
char *key; char *key;
key = ignore_get_key(rec); key = ignore_get_key(rec);
printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, IRCTXT_UNIGNORED, key); printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, TXT_UNIGNORED, key);
g_free(key); g_free(key);
rec->level = 0; rec->level = 0;
@ -272,7 +272,7 @@ static void cmd_unignore(const char *data)
} }
if (rec == NULL) if (rec == NULL)
printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, IRCTXT_IGNORE_NOT_FOUND, data); printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, TXT_IGNORE_NOT_FOUND, data);
else else
fe_unignore(rec); fe_unignore(rec);
} }

View File

@ -101,7 +101,7 @@ static void cmd_log_open(const char *data)
/* start logging */ /* start logging */
if (log_start_logging(log)) { if (log_start_logging(log)) {
printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE,
IRCTXT_LOG_OPENED, fname); TXT_LOG_OPENED, fname);
} else { } else {
log_close(log); log_close(log);
} }
@ -129,10 +129,10 @@ static void cmd_log_close(const char *data)
log = log_find_from_data(data); log = log_find_from_data(data);
if (log == NULL) if (log == NULL)
printformat(NULL, NULL, MSGLEVEL_CLIENTERROR, IRCTXT_LOG_NOT_OPEN, data); printformat(NULL, NULL, MSGLEVEL_CLIENTERROR, TXT_LOG_NOT_OPEN, data);
else { else {
log_close(log); log_close(log);
printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, IRCTXT_LOG_CLOSED, data); printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, TXT_LOG_CLOSED, data);
} }
} }
@ -144,7 +144,7 @@ static void cmd_log_start(const char *data)
log = log_find_from_data(data); log = log_find_from_data(data);
if (log != NULL) { if (log != NULL) {
log_start_logging(log); log_start_logging(log);
printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, IRCTXT_LOG_OPENED, data); printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, TXT_LOG_OPENED, data);
} }
} }
@ -155,10 +155,10 @@ static void cmd_log_stop(const char *data)
log = log_find_from_data(data); log = log_find_from_data(data);
if (log == NULL || log->handle == -1) if (log == NULL || log->handle == -1)
printformat(NULL, NULL, MSGLEVEL_CLIENTERROR, IRCTXT_LOG_NOT_OPEN, data); printformat(NULL, NULL, MSGLEVEL_CLIENTERROR, TXT_LOG_NOT_OPEN, data);
else { else {
log_stop_logging(log); log_stop_logging(log);
printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, IRCTXT_LOG_CLOSED, data); printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, TXT_LOG_CLOSED, data);
} }
} }
@ -191,7 +191,7 @@ static void cmd_log_list(void)
char *levelstr, *items; char *levelstr, *items;
int index; int index;
printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, IRCTXT_LOG_LIST_HEADER); printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, TXT_LOG_LIST_HEADER);
for (tmp = logs, index = 1; tmp != NULL; tmp = tmp->next, index++) { for (tmp = logs, index = 1; tmp != NULL; tmp = tmp->next, index++) {
LOG_REC *rec = tmp->data; LOG_REC *rec = tmp->data;
@ -199,14 +199,14 @@ static void cmd_log_list(void)
items = rec->items == NULL ? NULL : items = rec->items == NULL ? NULL :
log_items_get_list(rec); log_items_get_list(rec);
printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, IRCTXT_LOG_LIST, printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, TXT_LOG_LIST,
index, rec->fname, items != NULL ? items : "", index, rec->fname, items != NULL ? items : "",
levelstr, rec->autoopen ? " -autoopen" : ""); levelstr, rec->autoopen ? " -autoopen" : "");
g_free_not_null(items); g_free_not_null(items);
g_free(levelstr); g_free(levelstr);
} }
printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, IRCTXT_LOG_LIST_FOOTER); printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, TXT_LOG_LIST_FOOTER);
} }
static void cmd_log(const char *data, SERVER_REC *server, void *item) static void cmd_log(const char *data, SERVER_REC *server, void *item)
@ -259,7 +259,7 @@ static void cmd_window_log(const char *data)
open_log = log == NULL; open_log = log == NULL;
close_log = log != NULL; close_log = log != NULL;
} else { } else {
printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, IRCTXT_NOT_TOGGLE); printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, TXT_NOT_TOGGLE);
cmd_params_free(free_arg); cmd_params_free(free_arg);
return; return;
} }
@ -278,10 +278,10 @@ static void cmd_window_log(const char *data)
if (open_log && log != NULL) { if (open_log && log != NULL) {
log_start_logging(log); log_start_logging(log);
printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, IRCTXT_LOG_OPENED, log->fname); printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, TXT_LOG_OPENED, log->fname);
} else if (close_log && log != NULL && log->handle != -1) { } else if (close_log && log != NULL && log->handle != -1) {
log_stop_logging(log); log_stop_logging(log);
printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, IRCTXT_LOG_CLOSED, log->fname); printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, TXT_LOG_CLOSED, log->fname);
} }
cmd_params_free(free_arg); cmd_params_free(free_arg);
@ -298,7 +298,7 @@ static void cmd_window_logfile(const char *data)
log = logs_find_item(LOG_ITEM_WINDOW_REFNUM, window, NULL, NULL); log = logs_find_item(LOG_ITEM_WINDOW_REFNUM, window, NULL, NULL);
if (log != NULL) { if (log != NULL) {
printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, IRCTXT_WINDOWLOG_FILE_LOGGING); printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, TXT_WINDOWLOG_FILE_LOGGING);
return; return;
} }
@ -306,7 +306,7 @@ static void cmd_window_logfile(const char *data)
log_item_add(log, LOG_ITEM_WINDOW_REFNUM, window, NULL); log_item_add(log, LOG_ITEM_WINDOW_REFNUM, window, NULL);
log_update(log); log_update(log);
printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, IRCTXT_WINDOWLOG_FILE, data); printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, TXT_WINDOWLOG_FILE, data);
} }
/* window's refnum changed - update the logs to log the new window refnum */ /* window's refnum changed - update the logs to log the new window refnum */
@ -522,13 +522,13 @@ static void sig_window_item_destroy(WINDOW_REC *window, WI_ITEM_REC *item)
static void sig_log_locked(LOG_REC *log) static void sig_log_locked(LOG_REC *log)
{ {
printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE,
IRCTXT_LOG_LOCKED, log->fname); TXT_LOG_LOCKED, log->fname);
} }
static void sig_log_create_failed(LOG_REC *log) static void sig_log_create_failed(LOG_REC *log)
{ {
printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE,
IRCTXT_LOG_CREATE_FAILED, log->fname, g_strerror(errno)); TXT_LOG_CREATE_FAILED, log->fname, g_strerror(errno));
} }
static void sig_awaylog_show(LOG_REC *log, gpointer pmsgs, gpointer pfilepos) static void sig_awaylog_show(LOG_REC *log, gpointer pmsgs, gpointer pfilepos)
@ -540,9 +540,9 @@ static void sig_awaylog_show(LOG_REC *log, gpointer pmsgs, gpointer pfilepos)
filepos = GPOINTER_TO_INT(pfilepos); filepos = GPOINTER_TO_INT(pfilepos);
if (msgs == 0) if (msgs == 0)
printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, IRCTXT_LOG_NO_AWAY_MSGS, log->fname); printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, TXT_LOG_NO_AWAY_MSGS, log->fname);
else { else {
printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, IRCTXT_LOG_AWAY_MSGS, log->fname, msgs); printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, TXT_LOG_AWAY_MSGS, log->fname, msgs);
str = g_strdup_printf("\"%s\" %d", log->fname, filepos); str = g_strdup_printf("\"%s\" %d", log->fname, filepos);
signal_emit("command cat", 1, str); signal_emit("command cat", 1, str);

View File

@ -164,11 +164,11 @@ static void sig_message_public(SERVER_REC *server, const char *msg,
if (color != NULL) { if (color != NULL) {
/* highlighted nick */ /* highlighted nick */
printformat(server, target, level, printformat(server, target, level,
IRCTXT_PUBMSG_HILIGHT, TXT_PUBMSG_HILIGHT,
color, nick, msg, nickmode); color, nick, msg, nickmode);
} else { } else {
printformat(server, target, level, printformat(server, target, level,
for_me ? IRCTXT_PUBMSG_ME : IRCTXT_PUBMSG, for_me ? TXT_PUBMSG_ME : TXT_PUBMSG,
nick, msg, nickmode); nick, msg, nickmode);
} }
} else { } else {
@ -176,12 +176,12 @@ static void sig_message_public(SERVER_REC *server, const char *msg,
if (color != NULL) { if (color != NULL) {
/* highlighted nick */ /* highlighted nick */
printformat(server, target, level, printformat(server, target, level,
IRCTXT_PUBMSG_HILIGHT_CHANNEL, TXT_PUBMSG_HILIGHT_CHANNEL,
color, nick, target, msg, nickmode); color, nick, target, msg, nickmode);
} else { } else {
printformat(server, target, level, printformat(server, target, level,
for_me ? IRCTXT_PUBMSG_ME_CHANNEL : for_me ? TXT_PUBMSG_ME_CHANNEL :
IRCTXT_PUBMSG_CHANNEL, TXT_PUBMSG_CHANNEL,
nick, target, msg, nickmode); nick, target, msg, nickmode);
} }
} }
@ -204,8 +204,8 @@ static void sig_message_private(SERVER_REC *server, const char *msg,
freemsg = NULL; freemsg = NULL;
printformat(server, nick, MSGLEVEL_MSGS, printformat(server, nick, MSGLEVEL_MSGS,
query == NULL ? IRCTXT_MSG_PRIVATE : query == NULL ? TXT_MSG_PRIVATE :
IRCTXT_MSG_PRIVATE_QUERY, nick, address, msg); TXT_MSG_PRIVATE_QUERY, nick, address, msg);
g_free_not_null(freemsg); g_free_not_null(freemsg);
} }
@ -231,10 +231,10 @@ static void print_own_channel_message(SERVER_REC *server, CHANNEL_REC *channel,
if (!print_channel) { if (!print_channel) {
printformat(server, target, MSGLEVEL_PUBLIC | MSGLEVEL_NOHILIGHT | MSGLEVEL_NO_ACT, printformat(server, target, MSGLEVEL_PUBLIC | MSGLEVEL_NOHILIGHT | MSGLEVEL_NO_ACT,
IRCTXT_OWN_MSG, server->nick, msg, nickmode); TXT_OWN_MSG, server->nick, msg, nickmode);
} else { } else {
printformat(server, target, MSGLEVEL_PUBLIC | MSGLEVEL_NOHILIGHT | MSGLEVEL_NO_ACT, printformat(server, target, MSGLEVEL_PUBLIC | MSGLEVEL_NOHILIGHT | MSGLEVEL_NO_ACT,
IRCTXT_OWN_MSG_CHANNEL, server->nick, target, msg, nickmode); TXT_OWN_MSG_CHANNEL, server->nick, target, msg, nickmode);
} }
} }
@ -266,8 +266,8 @@ static void sig_message_own_private(SERVER_REC *server, const char *msg,
strcmp(origtarget, ".") == 0); strcmp(origtarget, ".") == 0);
printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE,
*origtarget == ',' ? IRCTXT_NO_MSGS_GOT : *origtarget == ',' ? TXT_NO_MSGS_GOT :
IRCTXT_NO_MSGS_SENT); TXT_NO_MSGS_SENT);
signal_stop(); signal_stop();
return; return;
} }
@ -275,15 +275,15 @@ static void sig_message_own_private(SERVER_REC *server, const char *msg,
query = privmsg_get_query(server, target, TRUE, MSGLEVEL_MSGS); query = privmsg_get_query(server, target, TRUE, MSGLEVEL_MSGS);
printformat(server, target, printformat(server, target,
MSGLEVEL_MSGS | MSGLEVEL_NOHILIGHT | MSGLEVEL_NO_ACT, MSGLEVEL_MSGS | MSGLEVEL_NOHILIGHT | MSGLEVEL_NO_ACT,
query == NULL ? IRCTXT_OWN_MSG_PRIVATE : query == NULL ? TXT_OWN_MSG_PRIVATE :
IRCTXT_OWN_MSG_PRIVATE_QUERY, target, msg, server->nick); TXT_OWN_MSG_PRIVATE_QUERY, target, msg, server->nick);
} }
static void sig_message_join(SERVER_REC *server, const char *channel, static void sig_message_join(SERVER_REC *server, const char *channel,
const char *nick, const char *address) const char *nick, const char *address)
{ {
printformat(server, channel, MSGLEVEL_JOINS, printformat(server, channel, MSGLEVEL_JOINS,
IRCTXT_JOIN, nick, address, channel); TXT_JOIN, nick, address, channel);
} }
static void sig_message_part(SERVER_REC *server, const char *channel, static void sig_message_part(SERVER_REC *server, const char *channel,
@ -291,7 +291,7 @@ static void sig_message_part(SERVER_REC *server, const char *channel,
const char *reason) const char *reason)
{ {
printformat(server, channel, MSGLEVEL_PARTS, printformat(server, channel, MSGLEVEL_PARTS,
IRCTXT_PART, nick, address, channel, reason); TXT_PART, nick, address, channel, reason);
} }
static void sig_message_quit(SERVER_REC *server, const char *nick, static void sig_message_quit(SERVER_REC *server, const char *nick,
@ -334,7 +334,7 @@ static void sig_message_quit(SERVER_REC *server, const char *nick,
if (g_slist_find(windows, window) == NULL) { if (g_slist_find(windows, window) == NULL) {
windows = g_slist_append(windows, window); windows = g_slist_append(windows, window);
printformat(server, rec->name, MSGLEVEL_QUITS, printformat(server, rec->name, MSGLEVEL_QUITS,
IRCTXT_QUIT, nick, address, reason); TXT_QUIT, nick, address, reason);
} }
} }
count++; count++;
@ -347,7 +347,7 @@ static void sig_message_quit(SERVER_REC *server, const char *nick,
QUERY_REC *query = query_find(server, nick); QUERY_REC *query = query_find(server, nick);
if (query != NULL) { if (query != NULL) {
printformat(server, nick, MSGLEVEL_QUITS, printformat(server, nick, MSGLEVEL_QUITS,
IRCTXT_QUIT, nick, address, reason); TXT_QUIT, nick, address, reason);
} }
} }
@ -355,7 +355,7 @@ static void sig_message_quit(SERVER_REC *server, const char *nick,
if (chans->len > 0) if (chans->len > 0)
g_string_truncate(chans, chans->len-1); g_string_truncate(chans, chans->len-1);
printformat(server, print_channel, MSGLEVEL_QUITS, printformat(server, print_channel, MSGLEVEL_QUITS,
count <= 1 ? IRCTXT_QUIT : IRCTXT_QUIT_ONCE, count <= 1 ? TXT_QUIT : TXT_QUIT_ONCE,
nick, address, reason, chans->str); nick, address, reason, chans->str);
} }
g_string_free(chans, TRUE); g_string_free(chans, TRUE);
@ -366,7 +366,7 @@ static void sig_message_kick(SERVER_REC *server, const char *channel,
const char *address, const char *reason) const char *address, const char *reason)
{ {
printformat(server, channel, MSGLEVEL_KICKS, printformat(server, channel, MSGLEVEL_KICKS,
IRCTXT_KICK, nick, channel, kicker, reason); TXT_KICK, nick, channel, kicker, reason);
} }
static void print_nick_change_channel(SERVER_REC *server, const char *channel, static void print_nick_change_channel(SERVER_REC *server, const char *channel,
@ -379,7 +379,7 @@ static void print_nick_change_channel(SERVER_REC *server, const char *channel,
return; return;
printformat(server, channel, MSGLEVEL_NICKS, printformat(server, channel, MSGLEVEL_NICKS,
ownnick ? IRCTXT_YOUR_NICK_CHANGED : IRCTXT_NICK_CHANGED, ownnick ? TXT_YOUR_NICK_CHANGED : TXT_NICK_CHANGED,
oldnick, newnick); oldnick, newnick);
} }
@ -428,7 +428,7 @@ static void print_nick_change(SERVER_REC *server, const char *newnick,
if (!msgprint && ownnick) { if (!msgprint && ownnick) {
printformat(server, NULL, MSGLEVEL_NICKS, printformat(server, NULL, MSGLEVEL_NICKS,
IRCTXT_YOUR_NICK_CHANGED, oldnick, newnick); TXT_YOUR_NICK_CHANGED, oldnick, newnick);
} }
} }
@ -451,7 +451,7 @@ static void sig_message_invite(SERVER_REC *server, const char *channel,
str = show_lowascii(channel); str = show_lowascii(channel);
printformat(server, NULL, MSGLEVEL_INVITES, printformat(server, NULL, MSGLEVEL_INVITES,
IRCTXT_INVITE, nick, str); TXT_INVITE, nick, str);
g_free(str); g_free(str);
} }
@ -460,7 +460,7 @@ static void sig_message_topic(SERVER_REC *server, const char *channel,
const char *nick, const char *address) const char *nick, const char *address)
{ {
printformat(server, channel, MSGLEVEL_TOPICS, printformat(server, channel, MSGLEVEL_TOPICS,
*topic != '\0' ? IRCTXT_NEW_TOPIC : IRCTXT_TOPIC_UNSET, *topic != '\0' ? TXT_NEW_TOPIC : TXT_TOPIC_UNSET,
nick, channel, topic); nick, channel, topic);
} }

View File

@ -31,25 +31,25 @@ static void sig_module_error(void *number, const char *module, const char *data)
{ {
switch (GPOINTER_TO_INT(number)) { switch (GPOINTER_TO_INT(number)) {
case MODULE_ERROR_ALREADY_LOADED: case MODULE_ERROR_ALREADY_LOADED:
printformat(NULL, NULL, MSGLEVEL_CLIENTERROR, IRCTXT_MODULE_ALREADY_LOADED, module); printformat(NULL, NULL, MSGLEVEL_CLIENTERROR, TXT_MODULE_ALREADY_LOADED, module);
break; break;
case MODULE_ERROR_LOAD: case MODULE_ERROR_LOAD:
printformat(NULL, NULL, MSGLEVEL_CLIENTERROR, IRCTXT_MODULE_LOAD_ERROR, module, data); printformat(NULL, NULL, MSGLEVEL_CLIENTERROR, TXT_MODULE_LOAD_ERROR, module, data);
break; break;
case MODULE_ERROR_INVALID: case MODULE_ERROR_INVALID:
printformat(NULL, NULL, MSGLEVEL_CLIENTERROR, IRCTXT_MODULE_INVALID, module); printformat(NULL, NULL, MSGLEVEL_CLIENTERROR, TXT_MODULE_INVALID, module);
break; break;
} }
} }
static void sig_module_loaded(MODULE_REC *rec) static void sig_module_loaded(MODULE_REC *rec)
{ {
printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, IRCTXT_MODULE_LOADED, rec->name); printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, TXT_MODULE_LOADED, rec->name);
} }
static void sig_module_unloaded(MODULE_REC *rec) static void sig_module_unloaded(MODULE_REC *rec)
{ {
printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, IRCTXT_MODULE_UNLOADED, rec->name); printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, TXT_MODULE_UNLOADED, rec->name);
} }
/* SYNTAX: LOAD <module> */ /* SYNTAX: LOAD <module> */

View File

@ -62,7 +62,7 @@ static void signal_query_created(QUERY_REC *query, gpointer automatic)
window_item_create((WI_ITEM_REC *) query, GPOINTER_TO_INT(automatic)); window_item_create((WI_ITEM_REC *) query, GPOINTER_TO_INT(automatic));
printformat(query->server, query->name, MSGLEVEL_CLIENTNOTICE, printformat(query->server, query->name, MSGLEVEL_CLIENTNOTICE,
IRCTXT_QUERY_STARTED, query->name); TXT_QUERY_STARTED, query->name);
} }
static void signal_query_created_curwin(QUERY_REC *query) static void signal_query_created_curwin(QUERY_REC *query)
@ -162,7 +162,7 @@ static void cmd_window_server(const char *data)
/* /WINDOW SERVER used in a query window */ /* /WINDOW SERVER used in a query window */
query_change_server(query, server); query_change_server(query, server);
printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE,
IRCTXT_QUERY_SERVER_CHANGED, TXT_QUERY_SERVER_CHANGED,
query->name, server->tag); query->name, server->tag);
signal_stop(); signal_stop();
} }
@ -182,7 +182,7 @@ static void cmd_unquery(const char *data, SERVER_REC *server, WI_ITEM_REC *item)
query = query_find(server, data); query = query_find(server, data);
if (query == NULL) { if (query == NULL) {
printformat(server, NULL, MSGLEVEL_CLIENTERROR, printformat(server, NULL, MSGLEVEL_CLIENTERROR,
IRCTXT_NO_QUERY, data); TXT_NO_QUERY, data);
return; return;
} }
} }

View File

@ -40,7 +40,7 @@ static void print_servers(void)
for (tmp = servers; tmp != NULL; tmp = tmp->next) { for (tmp = servers; tmp != NULL; tmp = tmp->next) {
SERVER_REC *rec = tmp->data; SERVER_REC *rec = tmp->data;
printformat(NULL, NULL, MSGLEVEL_CRAP, IRCTXT_SERVER_LIST, printformat(NULL, NULL, MSGLEVEL_CRAP, TXT_SERVER_LIST,
rec->tag, rec->connrec->address, rec->connrec->port, rec->tag, rec->connrec->address, rec->connrec->port,
rec->connrec->chatnet == NULL ? "" : rec->connrec->chatnet, rec->connrec->nick); rec->connrec->chatnet == NULL ? "" : rec->connrec->chatnet, rec->connrec->nick);
} }
@ -52,7 +52,7 @@ static void print_lookup_servers(void)
for (tmp = lookup_servers; tmp != NULL; tmp = tmp->next) { for (tmp = lookup_servers; tmp != NULL; tmp = tmp->next) {
SERVER_REC *rec = tmp->data; SERVER_REC *rec = tmp->data;
printformat(NULL, NULL, MSGLEVEL_CRAP, IRCTXT_SERVER_LOOKUP_LIST, printformat(NULL, NULL, MSGLEVEL_CRAP, TXT_SERVER_LOOKUP_LIST,
rec->tag, rec->connrec->address, rec->connrec->port, rec->tag, rec->connrec->address, rec->connrec->port,
rec->connrec->chatnet == NULL ? "" : rec->connrec->chatnet, rec->connrec->nick); rec->connrec->chatnet == NULL ? "" : rec->connrec->chatnet, rec->connrec->nick);
} }
@ -71,7 +71,7 @@ static void print_reconnects(void)
tag = g_strdup_printf("RECON-%d", rec->tag); tag = g_strdup_printf("RECON-%d", rec->tag);
left = rec->next_connect-time(NULL); left = rec->next_connect-time(NULL);
next_connect = g_strdup_printf("%02d:%02d", left/60, left%60); next_connect = g_strdup_printf("%02d:%02d", left/60, left%60);
printformat(NULL, NULL, MSGLEVEL_CRAP, IRCTXT_SERVER_RECONNECT_LIST, printformat(NULL, NULL, MSGLEVEL_CRAP, TXT_SERVER_RECONNECT_LIST,
tag, conn->address, conn->port, tag, conn->address, conn->port,
conn->chatnet == NULL ? "" : conn->chatnet, conn->chatnet == NULL ? "" : conn->chatnet,
conn->nick, next_connect); conn->nick, next_connect);
@ -137,7 +137,7 @@ static void cmd_server_add(const char *data)
signal_emit("server add fill", 2, rec, optlist); signal_emit("server add fill", 2, rec, optlist);
server_setup_add(rec); server_setup_add(rec);
printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, IRCTXT_SETUPSERVER_ADDED, addr, port); printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, TXT_SETUPSERVER_ADDED, addr, port);
cmd_params_free(free_arg); cmd_params_free(free_arg);
} }
@ -159,10 +159,10 @@ static void cmd_server_remove(const char *data)
rec = server_setup_find_port(addr, atoi(port)); rec = server_setup_find_port(addr, atoi(port));
if (rec == NULL) if (rec == NULL)
printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, IRCTXT_SETUPSERVER_NOT_FOUND, addr, port); printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, TXT_SETUPSERVER_NOT_FOUND, addr, port);
else { else {
server_setup_remove(rec); server_setup_remove(rec);
printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, IRCTXT_SETUPSERVER_REMOVED, addr, port); printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, TXT_SETUPSERVER_REMOVED, addr, port);
} }
cmd_params_free(free_arg); cmd_params_free(free_arg);
@ -207,7 +207,7 @@ static void sig_server_looking(SERVER_REC *server)
{ {
g_return_if_fail(server != NULL); g_return_if_fail(server != NULL);
printformat(server, NULL, MSGLEVEL_CLIENTNOTICE, IRCTXT_LOOKING_UP, server->connrec->address); printformat(server, NULL, MSGLEVEL_CLIENTNOTICE, TXT_LOOKING_UP, server->connrec->address);
} }
static void sig_server_connecting(SERVER_REC *server, IPADDR *ip) static void sig_server_connecting(SERVER_REC *server, IPADDR *ip)
@ -218,7 +218,7 @@ static void sig_server_connecting(SERVER_REC *server, IPADDR *ip)
g_return_if_fail(ip != NULL); g_return_if_fail(ip != NULL);
net_ip2host(ip, ipaddr); net_ip2host(ip, ipaddr);
printformat(server, NULL, MSGLEVEL_CLIENTNOTICE, IRCTXT_CONNECTING, printformat(server, NULL, MSGLEVEL_CLIENTNOTICE, TXT_CONNECTING,
server->connrec->address, ipaddr, server->connrec->port); server->connrec->address, ipaddr, server->connrec->port);
} }
@ -227,7 +227,7 @@ static void sig_server_connected(SERVER_REC *server)
g_return_if_fail(server != NULL); g_return_if_fail(server != NULL);
printformat(server, NULL, MSGLEVEL_CLIENTNOTICE, printformat(server, NULL, MSGLEVEL_CLIENTNOTICE,
IRCTXT_CONNECTION_ESTABLISHED, server->connrec->address); TXT_CONNECTION_ESTABLISHED, server->connrec->address);
} }
static void sig_connect_failed(SERVER_REC *server, gchar *msg) static void sig_connect_failed(SERVER_REC *server, gchar *msg)
@ -238,10 +238,10 @@ static void sig_connect_failed(SERVER_REC *server, gchar *msg)
/* no message so this wasn't unexpected fail - send /* no message so this wasn't unexpected fail - send
connection_lost message instead */ connection_lost message instead */
printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE,
IRCTXT_CONNECTION_LOST, server->connrec->address); TXT_CONNECTION_LOST, server->connrec->address);
} else { } else {
printformat(NULL, NULL, MSGLEVEL_CLIENTERROR, printformat(NULL, NULL, MSGLEVEL_CLIENTERROR,
IRCTXT_CANT_CONNECT, server->connrec->address, server->connrec->port, msg); TXT_CANT_CONNECT, server->connrec->address, server->connrec->port, msg);
} }
} }
@ -250,7 +250,7 @@ static void sig_server_disconnected(SERVER_REC *server)
g_return_if_fail(server != NULL); g_return_if_fail(server != NULL);
printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE,
IRCTXT_CONNECTION_LOST, server->connrec->address); TXT_CONNECTION_LOST, server->connrec->address);
} }
static void sig_server_quit(SERVER_REC *server, const char *msg) static void sig_server_quit(SERVER_REC *server, const char *msg)
@ -258,7 +258,7 @@ static void sig_server_quit(SERVER_REC *server, const char *msg)
g_return_if_fail(server != NULL); g_return_if_fail(server != NULL);
printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE,
IRCTXT_SERVER_QUIT, server->connrec->address, msg); TXT_SERVER_QUIT, server->connrec->address, msg);
} }
static void sig_server_lag_disconnected(SERVER_REC *server) static void sig_server_lag_disconnected(SERVER_REC *server)
@ -266,7 +266,7 @@ static void sig_server_lag_disconnected(SERVER_REC *server)
g_return_if_fail(server != NULL); g_return_if_fail(server != NULL);
printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE,
IRCTXT_LAG_DISCONNECTED, server->connrec->address, time(NULL)-server->lag_sent); TXT_LAG_DISCONNECTED, server->connrec->address, time(NULL)-server->lag_sent);
} }
static void sig_server_reconnect_removed(RECONNECT_REC *reconnect) static void sig_server_reconnect_removed(RECONNECT_REC *reconnect)
@ -274,7 +274,7 @@ static void sig_server_reconnect_removed(RECONNECT_REC *reconnect)
g_return_if_fail(reconnect != NULL); g_return_if_fail(reconnect != NULL);
printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE,
IRCTXT_RECONNECT_REMOVED, reconnect->conn->address, reconnect->conn->port, TXT_RECONNECT_REMOVED, reconnect->conn->address, reconnect->conn->port,
reconnect->conn->chatnet == NULL ? "" : reconnect->conn->chatnet); reconnect->conn->chatnet == NULL ? "" : reconnect->conn->chatnet);
} }
@ -283,7 +283,7 @@ static void sig_server_reconnect_not_found(const char *tag)
g_return_if_fail(tag != NULL); g_return_if_fail(tag != NULL);
printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE,
IRCTXT_RECONNECT_NOT_FOUND, tag); TXT_RECONNECT_NOT_FOUND, tag);
} }
void fe_server_init(void) void fe_server_init(void)

View File

@ -62,7 +62,7 @@ static void set_boolean(const char *key, const char *value)
else if (g_strcasecmp(value, "TOGGLE") == 0) else if (g_strcasecmp(value, "TOGGLE") == 0)
settings_set_bool(key, !settings_get_bool(key)); settings_set_bool(key, !settings_get_bool(key));
else else
printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, IRCTXT_NOT_TOGGLE); printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, TXT_NOT_TOGGLE);
} }
/* SYNTAX: SET [-clear] [<key> [<value>] */ /* SYNTAX: SET [-clear] [<key> [<value>] */
@ -160,7 +160,7 @@ static void show_aliases(const char *alias)
GSList *tmp, *list; GSList *tmp, *list;
int aliaslen; int aliaslen;
printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, IRCTXT_ALIASLIST_HEADER); printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, TXT_ALIASLIST_HEADER);
node = iconfig_node_traverse("aliases", FALSE); node = iconfig_node_traverse("aliases", FALSE);
tmp = node == NULL ? NULL : node->value; tmp = node == NULL ? NULL : node->value;
@ -184,20 +184,20 @@ static void show_aliases(const char *alias)
for (tmp = list; tmp != NULL; tmp = tmp->next) { for (tmp = list; tmp != NULL; tmp = tmp->next) {
CONFIG_NODE *node = tmp->data; CONFIG_NODE *node = tmp->data;
printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, IRCTXT_ALIASLIST_LINE, printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, TXT_ALIASLIST_LINE,
node->key, node->value); node->key, node->value);
} }
g_slist_free(list); g_slist_free(list);
printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, IRCTXT_ALIASLIST_FOOTER); printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, TXT_ALIASLIST_FOOTER);
} }
static void alias_remove(const char *alias) static void alias_remove(const char *alias)
{ {
if (iconfig_get_str("aliases", alias, NULL) == NULL) if (iconfig_get_str("aliases", alias, NULL) == NULL)
printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, IRCTXT_ALIAS_NOT_FOUND, alias); printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, TXT_ALIAS_NOT_FOUND, alias);
else { else {
printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, IRCTXT_ALIAS_REMOVED, alias); printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, TXT_ALIAS_REMOVED, alias);
iconfig_set_str("aliases", alias, NULL); iconfig_set_str("aliases", alias, NULL);
} }
} }
@ -218,7 +218,7 @@ static void cmd_alias(const char *data)
} else if (*alias == '\0' || *value == '\0') } else if (*alias == '\0' || *value == '\0')
show_aliases(alias); show_aliases(alias);
else { else {
printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, IRCTXT_ALIAS_ADDED, alias); printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, TXT_ALIAS_ADDED, alias);
iconfig_set_str("aliases", alias, value); iconfig_set_str("aliases", alias, value);
} }
cmd_params_free(free_arg); cmd_params_free(free_arg);
@ -242,7 +242,7 @@ static void cmd_reload(const char *data)
g_strdup_printf("%s/.irssi/config", g_get_home_dir()); g_strdup_printf("%s/.irssi/config", g_get_home_dir());
if (settings_reread(fname)) { if (settings_reread(fname)) {
printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE,
IRCTXT_CONFIG_RELOADED, fname); TXT_CONFIG_RELOADED, fname);
} }
g_free(fname); g_free(fname);
} }
@ -251,7 +251,7 @@ static void settings_save_fe(const char *fname)
{ {
if (settings_save(fname)) { if (settings_save(fname)) {
printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE,
IRCTXT_CONFIG_SAVED, fname); TXT_CONFIG_SAVED, fname);
} }
} }
@ -274,7 +274,7 @@ static void cmd_save(const char *data)
} }
printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE,
IRCTXT_CONFIG_MODIFIED, data); TXT_CONFIG_MODIFIED, data);
keyboard_entry_redirect((SIGNAL_FUNC) settings_save_confirm, keyboard_entry_redirect((SIGNAL_FUNC) settings_save_confirm,
_("Overwrite config (y/N)?"), _("Overwrite config (y/N)?"),
0, g_strdup(data)); 0, g_strdup(data));

View File

@ -437,7 +437,7 @@ static void sig_print_text(void)
/* day changed, print notice about it to every window */ /* day changed, print notice about it to every window */
for (tmp = windows; tmp != NULL; tmp = tmp->next) { for (tmp = windows; tmp != NULL; tmp = tmp->next) {
printformat_window(tmp->data, MSGLEVEL_NEVER, IRCTXT_DAYCHANGE, printformat_window(tmp->data, MSGLEVEL_NEVER, TXT_DAYCHANGE,
tm->tm_mday, tm->tm_mon+1, tm->tm_mday, tm->tm_mon+1,
1900+tm->tm_year, month); 1900+tm->tm_year, month);
} }

View File

@ -381,9 +381,9 @@ char *format_get_level_tag(THEME_REC *theme, TEXT_DEST_REC *dest)
int format; int format;
if (dest->level & LINE_START_IRSSI_LEVEL) if (dest->level & LINE_START_IRSSI_LEVEL)
format = IRCTXT_LINE_START_IRSSI; format = TXT_LINE_START_IRSSI;
else if ((dest->level & NOT_LINE_START_LEVEL) == 0) else if ((dest->level & NOT_LINE_START_LEVEL) == 0)
format = IRCTXT_LINE_START; format = TXT_LINE_START;
else else
return NULL; return NULL;
@ -410,7 +410,7 @@ static char *get_timestamp(THEME_REC *theme, TEXT_DEST_REC *dest, time_t t)
} }
tm = localtime(&t); tm = localtime(&t);
return format_get_text_theme(theme, MODULE_NAME, dest, IRCTXT_TIMESTAMP, return format_get_text_theme(theme, MODULE_NAME, dest, TXT_TIMESTAMP,
tm->tm_year+1900, tm->tm_year+1900,
tm->tm_mon+1, tm->tm_mday, tm->tm_mon+1, tm->tm_mday,
tm->tm_hour, tm->tm_min, tm->tm_sec); tm->tm_hour, tm->tm_min, tm->tm_sec);
@ -440,7 +440,7 @@ static char *get_server_tag(THEME_REC *theme, TEXT_DEST_REC *dest)
return count < 2 ? NULL : return count < 2 ? NULL :
format_get_text_theme(theme, MODULE_NAME, dest, format_get_text_theme(theme, MODULE_NAME, dest,
IRCTXT_SERVERTAG, server->tag); TXT_SERVERTAG, server->tag);
} }
char *format_get_line_start(THEME_REC *theme, TEXT_DEST_REC *dest, time_t t) char *format_get_line_start(THEME_REC *theme, TEXT_DEST_REC *dest, time_t t)

View File

@ -357,7 +357,7 @@ static void hilight_print(int index, HILIGHT_REC *rec)
levelstr = rec->level == 0 ? NULL : levelstr = rec->level == 0 ? NULL :
bits2level(rec->level); bits2level(rec->level);
printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP,
IRCTXT_HILIGHT_LINE, index, rec->text, TXT_HILIGHT_LINE, index, rec->text,
chans != NULL ? chans : "", chans != NULL ? chans : "",
levelstr != NULL ? levelstr : "", levelstr != NULL ? levelstr : "",
rec->nickmask ? " -nick" : "", rec->nickmask ? " -nick" : "",
@ -372,14 +372,14 @@ static void cmd_hilight_show(void)
GSList *tmp; GSList *tmp;
int index; int index;
printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, IRCTXT_HILIGHT_HEADER); printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, TXT_HILIGHT_HEADER);
index = 1; index = 1;
for (tmp = hilights; tmp != NULL; tmp = tmp->next, index++) { for (tmp = hilights; tmp != NULL; tmp = tmp->next, index++) {
HILIGHT_REC *rec = tmp->data; HILIGHT_REC *rec = tmp->data;
hilight_print(index, rec); hilight_print(index, rec);
} }
printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, IRCTXT_HILIGHT_FOOTER); printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, TXT_HILIGHT_FOOTER);
} }
/* SYNTAX: HILIGHT [-nick | -nonick] [-mask | -regexp | -word] /* SYNTAX: HILIGHT [-nick | -nonick] [-mask | -regexp | -word]
@ -464,9 +464,9 @@ static void cmd_dehilight(const char *data)
} }
if (rec == NULL) if (rec == NULL)
printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, IRCTXT_HILIGHT_NOT_FOUND, data); printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, TXT_HILIGHT_NOT_FOUND, data);
else { else {
printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, IRCTXT_HILIGHT_REMOVED, rec->text); printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, TXT_HILIGHT_REMOVED, rec->text);
hilight_remove(rec); hilight_remove(rec);
} }
} }

View File

@ -310,7 +310,7 @@ static void cmd_show_keys(const char *searchkey, int full)
if ((len == 0 || g_strncasecmp(rec->key, searchkey, len) == 0) && if ((len == 0 || g_strncasecmp(rec->key, searchkey, len) == 0) &&
(!full || rec->key[len] == '\0')) { (!full || rec->key[len] == '\0')) {
printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, IRCTXT_BIND_KEY, printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, TXT_BIND_KEY,
rec->key, rec->info->id, rec->data == NULL ? "" : rec->data); rec->key, rec->info->id, rec->data == NULL ? "" : rec->data);
} }
} }
@ -351,7 +351,7 @@ static void cmd_bind(const char *data)
} }
if (key_info_find(id) == NULL) if (key_info_find(id) == NULL)
printformat(NULL, NULL, MSGLEVEL_CLIENTERROR, IRCTXT_BIND_UNKNOWN_ID, id); printformat(NULL, NULL, MSGLEVEL_CLIENTERROR, TXT_BIND_UNKNOWN_ID, id);
else { else {
key_configure_add(id, key, keydata); key_configure_add(id, key, keydata);
cmd_show_keys(key, TRUE); cmd_show_keys(key, TRUE);

View File

@ -1,174 +1,174 @@
#include "formats.h" #include "formats.h"
enum { enum {
IRCTXT_MODULE_NAME, TXT_MODULE_NAME,
IRCTXT_FILL_1, TXT_FILL_1,
IRCTXT_LINE_START, TXT_LINE_START,
IRCTXT_LINE_START_IRSSI, TXT_LINE_START_IRSSI,
IRCTXT_TIMESTAMP, TXT_TIMESTAMP,
IRCTXT_SERVERTAG, TXT_SERVERTAG,
IRCTXT_DAYCHANGE, TXT_DAYCHANGE,
IRCTXT_TALKING_WITH, TXT_TALKING_WITH,
IRCTXT_REFNUM_TOO_LOW, TXT_REFNUM_TOO_LOW,
IRCTXT_WINDOWLIST_HEADER, TXT_WINDOWLIST_HEADER,
IRCTXT_WINDOWLIST_LINE, TXT_WINDOWLIST_LINE,
IRCTXT_WINDOWLIST_FOOTER, TXT_WINDOWLIST_FOOTER,
IRCTXT_FILL_2, TXT_FILL_2,
IRCTXT_LOOKING_UP, TXT_LOOKING_UP,
IRCTXT_CONNECTING, TXT_CONNECTING,
IRCTXT_CONNECTION_ESTABLISHED, TXT_CONNECTION_ESTABLISHED,
IRCTXT_CANT_CONNECT, TXT_CANT_CONNECT,
IRCTXT_CONNECTION_LOST, TXT_CONNECTION_LOST,
IRCTXT_LAG_DISCONNECTED, TXT_LAG_DISCONNECTED,
IRCTXT_DISCONNECTED, TXT_DISCONNECTED,
IRCTXT_SERVER_QUIT, TXT_SERVER_QUIT,
IRCTXT_SERVER_CHANGED, TXT_SERVER_CHANGED,
IRCTXT_UNKNOWN_SERVER_TAG, TXT_UNKNOWN_SERVER_TAG,
IRCTXT_SERVER_LIST, TXT_SERVER_LIST,
IRCTXT_SERVER_LOOKUP_LIST, TXT_SERVER_LOOKUP_LIST,
IRCTXT_SERVER_RECONNECT_LIST, TXT_SERVER_RECONNECT_LIST,
IRCTXT_RECONNECT_REMOVED, TXT_RECONNECT_REMOVED,
IRCTXT_RECONNECT_NOT_FOUND, TXT_RECONNECT_NOT_FOUND,
IRCTXT_SETUPSERVER_ADDED, TXT_SETUPSERVER_ADDED,
IRCTXT_SETUPSERVER_REMOVED, TXT_SETUPSERVER_REMOVED,
IRCTXT_SETUPSERVER_NOT_FOUND, TXT_SETUPSERVER_NOT_FOUND,
IRCTXT_FILL_3, TXT_FILL_3,
IRCTXT_JOIN, TXT_JOIN,
IRCTXT_PART, TXT_PART,
IRCTXT_KICK, TXT_KICK,
IRCTXT_QUIT, TXT_QUIT,
IRCTXT_QUIT_ONCE, TXT_QUIT_ONCE,
IRCTXT_INVITE, TXT_INVITE,
IRCTXT_NEW_TOPIC, TXT_NEW_TOPIC,
IRCTXT_TOPIC_UNSET, TXT_TOPIC_UNSET,
IRCTXT_YOUR_NICK_CHANGED, TXT_YOUR_NICK_CHANGED,
IRCTXT_NICK_CHANGED, TXT_NICK_CHANGED,
IRCTXT_TALKING_IN, TXT_TALKING_IN,
IRCTXT_NOT_IN_CHANNELS, TXT_NOT_IN_CHANNELS,
IRCTXT_CURRENT_CHANNEL, TXT_CURRENT_CHANNEL,
IRCTXT_CHANLIST_HEADER, TXT_CHANLIST_HEADER,
IRCTXT_CHANLIST_LINE, TXT_CHANLIST_LINE,
IRCTXT_CHANSETUP_NOT_FOUND, TXT_CHANSETUP_NOT_FOUND,
IRCTXT_CHANSETUP_ADDED, TXT_CHANSETUP_ADDED,
IRCTXT_CHANSETUP_REMOVED, TXT_CHANSETUP_REMOVED,
IRCTXT_CHANSETUP_HEADER, TXT_CHANSETUP_HEADER,
IRCTXT_CHANSETUP_LINE, TXT_CHANSETUP_LINE,
IRCTXT_CHANSETUP_FOOTER, TXT_CHANSETUP_FOOTER,
IRCTXT_FILL_4, TXT_FILL_4,
IRCTXT_OWN_MSG, TXT_OWN_MSG,
IRCTXT_OWN_MSG_CHANNEL, TXT_OWN_MSG_CHANNEL,
IRCTXT_OWN_MSG_PRIVATE, TXT_OWN_MSG_PRIVATE,
IRCTXT_OWN_MSG_PRIVATE_QUERY, TXT_OWN_MSG_PRIVATE_QUERY,
IRCTXT_PUBMSG_ME, TXT_PUBMSG_ME,
IRCTXT_PUBMSG_ME_CHANNEL, TXT_PUBMSG_ME_CHANNEL,
IRCTXT_PUBMSG_HILIGHT, TXT_PUBMSG_HILIGHT,
IRCTXT_PUBMSG_HILIGHT_CHANNEL, TXT_PUBMSG_HILIGHT_CHANNEL,
IRCTXT_PUBMSG, TXT_PUBMSG,
IRCTXT_PUBMSG_CHANNEL, TXT_PUBMSG_CHANNEL,
IRCTXT_MSG_PRIVATE, TXT_MSG_PRIVATE,
IRCTXT_MSG_PRIVATE_QUERY, TXT_MSG_PRIVATE_QUERY,
IRCTXT_NO_MSGS_GOT, TXT_NO_MSGS_GOT,
IRCTXT_NO_MSGS_SENT, TXT_NO_MSGS_SENT,
IRCTXT_FILL_5, TXT_FILL_5,
IRCTXT_QUERY_STARTED, TXT_QUERY_STARTED,
IRCTXT_NO_QUERY, TXT_NO_QUERY,
IRCTXT_QUERY_SERVER_CHANGED, TXT_QUERY_SERVER_CHANGED,
IRCTXT_FILL_6, TXT_FILL_6,
IRCTXT_HILIGHT_HEADER, TXT_HILIGHT_HEADER,
IRCTXT_HILIGHT_LINE, TXT_HILIGHT_LINE,
IRCTXT_HILIGHT_FOOTER, TXT_HILIGHT_FOOTER,
IRCTXT_HILIGHT_NOT_FOUND, TXT_HILIGHT_NOT_FOUND,
IRCTXT_HILIGHT_REMOVED, TXT_HILIGHT_REMOVED,
IRCTXT_FILL_7, TXT_FILL_7,
IRCTXT_ALIAS_ADDED, TXT_ALIAS_ADDED,
IRCTXT_ALIAS_REMOVED, TXT_ALIAS_REMOVED,
IRCTXT_ALIAS_NOT_FOUND, TXT_ALIAS_NOT_FOUND,
IRCTXT_ALIASLIST_HEADER, TXT_ALIASLIST_HEADER,
IRCTXT_ALIASLIST_LINE, TXT_ALIASLIST_LINE,
IRCTXT_ALIASLIST_FOOTER, TXT_ALIASLIST_FOOTER,
IRCTXT_FILL_8, TXT_FILL_8,
IRCTXT_LOG_OPENED, TXT_LOG_OPENED,
IRCTXT_LOG_CLOSED, TXT_LOG_CLOSED,
IRCTXT_LOG_CREATE_FAILED, TXT_LOG_CREATE_FAILED,
IRCTXT_LOG_LOCKED, TXT_LOG_LOCKED,
IRCTXT_LOG_NOT_OPEN, TXT_LOG_NOT_OPEN,
IRCTXT_LOG_STARTED, TXT_LOG_STARTED,
IRCTXT_LOG_STOPPED, TXT_LOG_STOPPED,
IRCTXT_LOG_LIST_HEADER, TXT_LOG_LIST_HEADER,
IRCTXT_LOG_LIST, TXT_LOG_LIST,
IRCTXT_LOG_LIST_FOOTER, TXT_LOG_LIST_FOOTER,
IRCTXT_WINDOWLOG_FILE, TXT_WINDOWLOG_FILE,
IRCTXT_WINDOWLOG_FILE_LOGGING, TXT_WINDOWLOG_FILE_LOGGING,
IRCTXT_LOG_NO_AWAY_MSGS, TXT_LOG_NO_AWAY_MSGS,
IRCTXT_LOG_AWAY_MSGS, TXT_LOG_AWAY_MSGS,
IRCTXT_FILL_9, TXT_FILL_9,
IRCTXT_MODULE_ALREADY_LOADED, TXT_MODULE_ALREADY_LOADED,
IRCTXT_MODULE_LOAD_ERROR, TXT_MODULE_LOAD_ERROR,
IRCTXT_MODULE_INVALID, TXT_MODULE_INVALID,
IRCTXT_MODULE_LOADED, TXT_MODULE_LOADED,
IRCTXT_MODULE_UNLOADED, TXT_MODULE_UNLOADED,
IRCTXT_FILL_10, TXT_FILL_10,
IRCTXT_COMMAND_UNKNOWN, TXT_COMMAND_UNKNOWN,
IRCTXT_COMMAND_AMBIGUOUS, TXT_COMMAND_AMBIGUOUS,
IRCTXT_OPTION_UNKNOWN, TXT_OPTION_UNKNOWN,
IRCTXT_OPTION_AMBIGUOUS, TXT_OPTION_AMBIGUOUS,
IRCTXT_OPTION_MISSING_ARG, TXT_OPTION_MISSING_ARG,
IRCTXT_NOT_ENOUGH_PARAMS, TXT_NOT_ENOUGH_PARAMS,
IRCTXT_NOT_CONNECTED, TXT_NOT_CONNECTED,
IRCTXT_NOT_JOINED, TXT_NOT_JOINED,
IRCTXT_CHAN_NOT_FOUND, TXT_CHAN_NOT_FOUND,
IRCTXT_CHAN_NOT_SYNCED, TXT_CHAN_NOT_SYNCED,
IRCTXT_NOT_GOOD_IDEA, TXT_NOT_GOOD_IDEA,
IRCTXT_FILL_11, TXT_FILL_11,
IRCTXT_THEME_SAVED, TXT_THEME_SAVED,
IRCTXT_THEME_SAVE_FAILED, TXT_THEME_SAVE_FAILED,
IRCTXT_THEME_NOT_FOUND, TXT_THEME_NOT_FOUND,
IRCTXT_WINDOW_THEME_CHANGED, TXT_WINDOW_THEME_CHANGED,
IRCTXT_FORMAT_TITLE, TXT_FORMAT_TITLE,
IRCTXT_FORMAT_SUBTITLE, TXT_FORMAT_SUBTITLE,
IRCTXT_FORMAT_ITEM, TXT_FORMAT_ITEM,
IRCTXT_FILL_12, TXT_FILL_12,
IRCTXT_IGNORED, TXT_IGNORED,
IRCTXT_UNIGNORED, TXT_UNIGNORED,
IRCTXT_IGNORE_NOT_FOUND, TXT_IGNORE_NOT_FOUND,
IRCTXT_IGNORE_NO_IGNORES, TXT_IGNORE_NO_IGNORES,
IRCTXT_IGNORE_HEADER, TXT_IGNORE_HEADER,
IRCTXT_IGNORE_LINE, TXT_IGNORE_LINE,
IRCTXT_IGNORE_FOOTER, TXT_IGNORE_FOOTER,
IRCTXT_FILL_13, TXT_FILL_13,
IRCTXT_NOT_TOGGLE, TXT_NOT_TOGGLE,
IRCTXT_PERL_ERROR, TXT_PERL_ERROR,
IRCTXT_BIND_KEY, TXT_BIND_KEY,
IRCTXT_BIND_UNKNOWN_ID, TXT_BIND_UNKNOWN_ID,
IRCTXT_CONFIG_SAVED, TXT_CONFIG_SAVED,
IRCTXT_CONFIG_RELOADED, TXT_CONFIG_RELOADED,
IRCTXT_CONFIG_MODIFIED TXT_CONFIG_MODIFIED
}; };
extern FORMAT_REC fecommon_core_formats[]; extern FORMAT_REC fecommon_core_formats[];

View File

@ -771,11 +771,11 @@ static void theme_show(THEME_SEARCH_REC *rec, const char *key, const char *value
else if ((value != NULL && key != NULL && g_strcasecmp(formats[n].tag, key) == 0) || else if ((value != NULL && key != NULL && g_strcasecmp(formats[n].tag, key) == 0) ||
(value == NULL && (key == NULL || stristr(formats[n].tag, key) != NULL))) { (value == NULL && (key == NULL || stristr(formats[n].tag, key) != NULL))) {
if (first) { if (first) {
printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, IRCTXT_FORMAT_TITLE, rec->short_name, formats[0].def); printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, TXT_FORMAT_TITLE, rec->short_name, formats[0].def);
first = FALSE; first = FALSE;
} }
if (last_title != NULL) if (last_title != NULL)
printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, IRCTXT_FORMAT_SUBTITLE, last_title); printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, TXT_FORMAT_SUBTITLE, last_title);
if (reset || value != NULL) { if (reset || value != NULL) {
theme = theme_module_create(current_theme, rec->name); theme = theme_module_create(current_theme, rec->name);
g_free_not_null(theme->formats[n]); g_free_not_null(theme->formats[n]);
@ -785,7 +785,7 @@ static void theme_show(THEME_SEARCH_REC *rec, const char *key, const char *value
theme->formats[n] = reset ? NULL : g_strdup(value); theme->formats[n] = reset ? NULL : g_strdup(value);
theme->expanded_formats[n] = theme_format_expand(current_theme, text); theme->expanded_formats[n] = theme_format_expand(current_theme, text);
} }
printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, IRCTXT_FORMAT_ITEM, formats[n].tag, text); printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, TXT_FORMAT_ITEM, formats[n].tag, text);
last_title = NULL; last_title = NULL;
} }
} }
@ -908,7 +908,7 @@ static void theme_save(THEME_REC *theme)
ok = FALSE; ok = FALSE;
} }
printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE,
ok ? IRCTXT_THEME_SAVED : IRCTXT_THEME_SAVE_FAILED, ok ? TXT_THEME_SAVED : TXT_THEME_SAVE_FAILED,
path, config_last_error(config)); path, config_last_error(config));
g_free(path); g_free(path);
config_close(config); config_close(config);

View File

@ -187,10 +187,10 @@ static void cmd_window_server(const char *data)
server = server_find_tag(data); server = server_find_tag(data);
if (server == NULL) if (server == NULL)
printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, IRCTXT_UNKNOWN_SERVER_TAG, data); printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, TXT_UNKNOWN_SERVER_TAG, data);
else if (active_win->active == NULL) { else if (active_win->active == NULL) {
window_change_server(active_win, server); window_change_server(active_win, server);
printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, IRCTXT_SERVER_CHANGED, server->tag, server->connrec->address, printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, TXT_SERVER_CHANGED, server->tag, server->connrec->address,
server->connrec->chatnet == NULL ? "" : server->connrec->chatnet); server->connrec->chatnet == NULL ? "" : server->connrec->chatnet);
} }
} }
@ -258,7 +258,7 @@ static void cmd_window_number(const char *data)
num = atoi(refnum); num = atoi(refnum);
if (num < 1) { if (num < 1) {
printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE,
IRCTXT_REFNUM_TOO_LOW); TXT_REFNUM_TOO_LOW);
} else { } else {
window_set_refnum(active_win, num); window_set_refnum(active_win, num);
active_win->sticky_refnum = active_win->sticky_refnum =
@ -376,12 +376,12 @@ static void cmd_window_list(void)
char *levelstr; char *levelstr;
sorted = windows_get_sorted(); sorted = windows_get_sorted();
printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, IRCTXT_WINDOWLIST_HEADER); printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, TXT_WINDOWLIST_HEADER);
for (tmp = sorted; tmp != NULL; tmp = tmp->next) { for (tmp = sorted; tmp != NULL; tmp = tmp->next) {
WINDOW_REC *rec = tmp->data; WINDOW_REC *rec = tmp->data;
levelstr = bits2level(rec->level); levelstr = bits2level(rec->level);
printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, IRCTXT_WINDOWLIST_LINE, printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, TXT_WINDOWLIST_LINE,
rec->refnum, rec->name == NULL ? "" : rec->name, rec->refnum, rec->name == NULL ? "" : rec->name,
rec->active == NULL ? "" : rec->active->name, rec->active == NULL ? "" : rec->active->name,
rec->active_server == NULL ? "" : ((SERVER_REC *) rec->active_server)->tag, rec->active_server == NULL ? "" : ((SERVER_REC *) rec->active_server)->tag,
@ -389,7 +389,7 @@ static void cmd_window_list(void)
g_free(levelstr); g_free(levelstr);
} }
g_slist_free(sorted); g_slist_free(sorted);
printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, IRCTXT_WINDOWLIST_FOOTER); printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, TXT_WINDOWLIST_FOOTER);
} }
/* SYNTAX: WINDOW THEME <name> */ /* SYNTAX: WINDOW THEME <name> */
@ -401,10 +401,10 @@ static void cmd_window_theme(const char *data)
active_win->theme = theme_load(data); active_win->theme = theme_load(data);
if (active_win->theme != NULL) { if (active_win->theme != NULL) {
printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE,
IRCTXT_WINDOW_THEME_CHANGED, data); TXT_WINDOW_THEME_CHANGED, data);
} else { } else {
printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE,
IRCTXT_THEME_NOT_FOUND, data); TXT_THEME_NOT_FOUND, data);
} }
} }

View File

@ -313,7 +313,7 @@ static void signal_window_item_changed(WINDOW_REC *window, WI_ITEM_REC *item)
/* default to printing "talking with ...", /* default to printing "talking with ...",
you can override it it you wish */ you can override it it you wish */
printformat(item->server, item->name, MSGLEVEL_CLIENTNOTICE, printformat(item->server, item->name, MSGLEVEL_CLIENTNOTICE,
IRCTXT_TALKING_WITH, item->name); TXT_TALKING_WITH, item->name);
} }
} }

View File

@ -34,38 +34,44 @@
#include "window-items.h" #include "window-items.h"
#include "printtext.h" #include "printtext.h"
static void ctcp_print(const char *pre, const char *data, static void ctcp_print(IRC_SERVER_REC *server,
IRC_SERVER_REC *server, const char *nick, const char *prefix, const char *data,
const char *addr, const char *target) const char *nick, const char *addr, const char *target)
{ {
char *str; char *str;
g_return_if_fail(data != NULL); str = *data == '\0' ? g_strdup(prefix) :
g_strconcat(prefix, " ", data, NULL);
str = g_strconcat(pre, " ", data, NULL); signal_emit("message irc ctcp", 5, server, str, nick, addr, target);
printformat(server, ischannel(*target) ? target : nick, MSGLEVEL_CTCPS,
IRCTXT_CTCP_REQUESTED, nick, addr, str, target);
g_free(str); g_free(str);
} }
static void ctcp_default_msg(IRC_SERVER_REC *server, const char *data, const char *nick, const char *addr, const char *target) static void ctcp_default_msg(IRC_SERVER_REC *server, const char *data,
const char *nick, const char *addr,
const char *target)
{ {
ctcp_print("unknown CTCP", data, server, nick, addr, target); ctcp_print(server, "unknown CTCP", data, nick, addr, target);
} }
static void ctcp_ping_msg(IRC_SERVER_REC *server, const char *data, const char *nick, const char *addr, const char *target) static void ctcp_ping_msg(IRC_SERVER_REC *server, const char *data,
const char *nick, const char *addr,
const char *target)
{ {
ctcp_print("CTCP PING", data, server, nick, addr, target); ctcp_print(server, "CTCP PING", data, nick, addr, target);
} }
static void ctcp_version_msg(IRC_SERVER_REC *server, const char *data, const char *nick, const char *addr, const char *target) static void ctcp_version_msg(IRC_SERVER_REC *server, const char *data,
const char *nick, const char *addr,
const char *target)
{ {
ctcp_print("CTCP VERSION", data, server, nick, addr, target); ctcp_print(server, "CTCP VERSION", data, nick, addr, target);
} }
static void ctcp_time_msg(IRC_SERVER_REC *server, const char *data, const char *nick, const char *addr, const char *target) static void ctcp_time_msg(IRC_SERVER_REC *server, const char *data,
const char *nick, const char *addr,
const char *target)
{ {
ctcp_print("CTCP TIME", data, server, nick, addr, target); ctcp_print(server, "CTCP TIME", data, nick, addr, target);
} }
static void ctcp_default_reply(IRC_SERVER_REC *server, const char *data, static void ctcp_default_reply(IRC_SERVER_REC *server, const char *data,
@ -87,7 +93,8 @@ static void ctcp_default_reply(IRC_SERVER_REC *server, const char *data,
} }
printformat(server, ischannel(*target) ? target : nick, MSGLEVEL_CTCPS, printformat(server, ischannel(*target) ? target : nick, MSGLEVEL_CTCPS,
ischannel(*target) ? IRCTXT_CTCP_REPLY_CHANNEL : IRCTXT_CTCP_REPLY, ctcp, nick, ctcpdata, target); ischannel(*target) ? IRCTXT_CTCP_REPLY_CHANNEL :
IRCTXT_CTCP_REPLY, ctcp, nick, ctcpdata, target);
g_free(ctcp); g_free(ctcp);
} }

View File

@ -25,9 +25,8 @@
#include "irc.h" #include "irc.h"
/* FIXME: hmm. there's should be some better way to use other module's
formats than this since now we can't use this module's formats.. */
#include "../core/module-formats.h" #include "../core/module-formats.h"
#include "module-formats.h"
#include "printtext.h" #include "printtext.h"
#include "fe-messages.h" #include "fe-messages.h"
@ -45,7 +44,7 @@ static void sig_message_own_public(SERVER_REC *server, const char *msg,
printformat_module("fe-common/core", server, target+1, printformat_module("fe-common/core", server, target+1,
MSGLEVEL_PUBLIC | MSGLEVEL_NOHILIGHT | MSGLEVEL_PUBLIC | MSGLEVEL_NOHILIGHT |
MSGLEVEL_NO_ACT, MSGLEVEL_NO_ACT,
IRCTXT_OWN_MSG_CHANNEL, TXT_OWN_MSG_CHANNEL,
server->nick, target, msg, nickmode); server->nick, target, msg, nickmode);
signal_stop(); signal_stop();
} }
@ -63,19 +62,29 @@ static void sig_message_irc_op_public(SERVER_REC *server, const char *msg,
optarget = g_strconcat("@", target, NULL); optarget = g_strconcat("@", target, NULL);
printformat_module("fe-common/core", server, target, printformat_module("fe-common/core", server, target,
MSGLEVEL_PUBLIC | MSGLEVEL_HILIGHT, MSGLEVEL_PUBLIC | MSGLEVEL_HILIGHT,
IRCTXT_PUBMSG_ME_CHANNEL, TXT_PUBMSG_ME_CHANNEL,
nick, optarget, msg, nickmode); nick, optarget, msg, nickmode);
g_free(optarget); g_free(optarget);
} }
static void sig_message_irc_ctcp(IRC_SERVER_REC *server, const char *msg,
const char *nick, const char *addr,
const char *target)
{
printformat(server, ischannel(*target) ? target : nick, MSGLEVEL_CTCPS,
IRCTXT_CTCP_REQUESTED, nick, addr, msg, target);
}
void fe_irc_messages_init(void) void fe_irc_messages_init(void)
{ {
signal_add("message own_public", (SIGNAL_FUNC) sig_message_own_public); signal_add("message own_public", (SIGNAL_FUNC) sig_message_own_public);
signal_add("message irc op_public", (SIGNAL_FUNC) sig_message_irc_op_public); signal_add("message irc op_public", (SIGNAL_FUNC) sig_message_irc_op_public);
signal_add("message irc ctcp", (SIGNAL_FUNC) sig_message_irc_ctcp);
} }
void fe_irc_messages_deinit(void) void fe_irc_messages_deinit(void)
{ {
signal_remove("message own_public", (SIGNAL_FUNC) sig_message_own_public); signal_remove("message own_public", (SIGNAL_FUNC) sig_message_own_public);
signal_remove("message irc op_public", (SIGNAL_FUNC) sig_message_irc_op_public); signal_remove("message irc op_public", (SIGNAL_FUNC) sig_message_irc_op_public);
signal_remove("message irc ctcp", (SIGNAL_FUNC) sig_message_irc_ctcp);
} }

View File

@ -204,7 +204,7 @@ static void cmd_lastlog(const char *data)
} }
if ((flags & LASTLOG_FLAG_NOHEADERS) == 0) if ((flags & LASTLOG_FLAG_NOHEADERS) == 0)
printformat(NULL, NULL, MSGLEVEL_LASTLOG, IRCTXT_LASTLOG_START); printformat(NULL, NULL, MSGLEVEL_LASTLOG, TXT_LASTLOG_START);
if (flags & LASTLOG_FLAG_NEW_LAST) if (flags & LASTLOG_FLAG_NEW_LAST)
startline = WINDOW_GUI(active_win)->lastlog_last_check; startline = WINDOW_GUI(active_win)->lastlog_last_check;
@ -238,7 +238,7 @@ static void cmd_lastlog(const char *data)
} }
if ((flags & LASTLOG_FLAG_NOHEADERS) == 0) if ((flags & LASTLOG_FLAG_NOHEADERS) == 0)
printformat(NULL, NULL, MSGLEVEL_LASTLOG, IRCTXT_LASTLOG_END); printformat(NULL, NULL, MSGLEVEL_LASTLOG, TXT_LASTLOG_END);
WINDOW_GUI(active_win)->lastlog_last_check = WINDOW_GUI(active_win)->lastlog_last_check =
g_list_last(WINDOW_GUI(active_win)->bottom_startline); g_list_last(WINDOW_GUI(active_win)->bottom_startline);

View File

@ -478,7 +478,7 @@ static void cmd_window_grow(const char *data)
window->first_line -= count; window->first_line -= count;
shrink_win->last_line -= count; shrink_win->last_line -= count;
} else { } else {
printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, IRCTXT_WINDOW_TOO_SMALL); printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, TXT_WINDOW_TOO_SMALL);
return; return;
} }
} }
@ -496,7 +496,7 @@ static void cmd_window_shrink(const char *data)
window = WINDOW_GUI(active_win)->parent; window = WINDOW_GUI(active_win)->parent;
if (window->lines-count < WINDOW_MIN_SIZE) { if (window->lines-count < WINDOW_MIN_SIZE) {
printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, IRCTXT_WINDOW_TOO_SMALL); printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, TXT_WINDOW_TOO_SMALL);
return; return;
} }
@ -579,7 +579,7 @@ static void cmd_window_hide(const char *data)
WINDOW_REC *window; WINDOW_REC *window;
if (mainwindows->next == NULL) { if (mainwindows->next == NULL) {
printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, IRCTXT_CANT_HIDE_LAST); printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, TXT_CANT_HIDE_LAST);
return; return;
} }

View File

@ -1,13 +1,13 @@
#include "formats.h" #include "formats.h"
enum { enum {
IRCTXT_MODULE_NAME, TXT_MODULE_NAME,
IRCTXT_LASTLOG_START, TXT_LASTLOG_START,
IRCTXT_LASTLOG_END, TXT_LASTLOG_END,
IRCTXT_WINDOW_TOO_SMALL, TXT_WINDOW_TOO_SMALL,
IRCTXT_CANT_HIDE_LAST TXT_CANT_HIDE_LAST
}; };
extern FORMAT_REC gui_text_formats[]; extern FORMAT_REC gui_text_formats[];