mirror of
https://github.com/irssi/irssi.git
synced 2026-08-10 12:23:37 +02:00
.. lots of changes ..
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@197 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
bacfcb060c
commit
d3dc9a1307
106 changed files with 4864 additions and 1597 deletions
|
|
@ -15,13 +15,15 @@ libfe_common_irc_la_SOURCES = \
|
|||
completion.c \
|
||||
fe-channels.c \
|
||||
fe-irc-commands.c \
|
||||
fe-irc-server.c \
|
||||
fe-ctcp.c \
|
||||
fe-events.c \
|
||||
fe-events-numeric.c \
|
||||
fe-ignore.c \
|
||||
fe-netsplit.c \
|
||||
fe-query.c \
|
||||
fe-common-irc.c \
|
||||
irc-nick-hilight.c \
|
||||
irc-window-activity.c \
|
||||
irc-hilight-text.c \
|
||||
module-formats.c
|
||||
|
||||
|
|
|
|||
|
|
@ -6,9 +6,9 @@ enum {
|
|||
IRCTXT_FILL_1,
|
||||
|
||||
IRCTXT_OWN_DCC,
|
||||
IRCTXT_DCC_MSG,
|
||||
IRCTXT_OWN_DCC_ME,
|
||||
IRCTXT_OWN_DCC_CTCP,
|
||||
IRCTXT_DCC_MSG,
|
||||
IRCTXT_ACTION_DCC,
|
||||
IRCTXT_DCC_CTCP,
|
||||
IRCTXT_DCC_CHAT,
|
||||
|
|
|
|||
|
|
@ -24,9 +24,12 @@
|
|||
#include "signals.h"
|
||||
#include "commands.h"
|
||||
#include "levels.h"
|
||||
#include "misc.h"
|
||||
|
||||
#include "irc.h"
|
||||
#include "channels.h"
|
||||
#include "channels-setup.h"
|
||||
#include "nicklist.h"
|
||||
|
||||
#include "windows.h"
|
||||
#include "window-items.h"
|
||||
|
|
@ -100,6 +103,134 @@ static void cmd_wjoin(const char *data, void *server, WI_ITEM_REC *item)
|
|||
signal_remove("channel created", (SIGNAL_FUNC) signal_channel_created_curwin);
|
||||
}
|
||||
|
||||
static void cmd_channel_list_joined(void)
|
||||
{
|
||||
CHANNEL_REC *channel;
|
||||
GString *nicks;
|
||||
GSList *nicklist, *tmp, *ntmp;
|
||||
char *mode;
|
||||
|
||||
if (channels == NULL) {
|
||||
printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, IRCTXT_NOT_IN_CHANNELS);
|
||||
return;
|
||||
}
|
||||
|
||||
/* print active channel */
|
||||
channel = irc_item_channel(active_win->active);
|
||||
if (channel != NULL)
|
||||
printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, IRCTXT_CURRENT_CHANNEL, channel->name);
|
||||
|
||||
/* print list of all channels, their modes, server tags and nicks */
|
||||
printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, IRCTXT_CHANLIST_HEADER);
|
||||
for (tmp = channels; tmp != NULL; tmp = tmp->next) {
|
||||
channel = tmp->data;
|
||||
|
||||
nicklist = nicklist_getnicks(channel);
|
||||
mode = channel_get_mode(channel);
|
||||
nicks = g_string_new(NULL);
|
||||
for (ntmp = nicklist; ntmp != NULL; ntmp = ntmp->next) {
|
||||
NICK_REC *rec = ntmp->data;
|
||||
|
||||
g_string_sprintfa(nicks, "%s ", rec->nick);
|
||||
}
|
||||
|
||||
g_string_truncate(nicks, nicks->len-1);
|
||||
printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, IRCTXT_CHANLIST_LINE,
|
||||
channel->name, mode, channel->server->tag, nicks->str);
|
||||
|
||||
g_free(mode);
|
||||
g_slist_free(nicklist);
|
||||
g_string_free(nicks, TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
static void cmd_channel_list(void)
|
||||
{
|
||||
GString *str;
|
||||
GSList *tmp;
|
||||
|
||||
str = g_string_new(NULL);
|
||||
printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, IRCTXT_CHANSETUP_HEADER);
|
||||
for (tmp = setupchannels; tmp != NULL; tmp = tmp->next) {
|
||||
SETUP_CHANNEL_REC *rec = tmp->data;
|
||||
|
||||
g_string_truncate(str, 0);
|
||||
if (rec->autojoin)
|
||||
g_string_append(str, "autojoin ");
|
||||
if (rec->botmasks != NULL && *rec->botmasks != '\0')
|
||||
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_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);
|
||||
}
|
||||
g_string_free(str, TRUE);
|
||||
printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, IRCTXT_CHANSETUP_FOOTER);
|
||||
}
|
||||
|
||||
static void cmd_channel(const char *data, IRC_SERVER_REC *server, WI_ITEM_REC *item)
|
||||
{
|
||||
if (ischannel(*data)) {
|
||||
signal_emit("command join", 2, data, server);
|
||||
return;
|
||||
}
|
||||
|
||||
command_runsub("channel", data, server, item);
|
||||
}
|
||||
|
||||
static void cmd_channel_add(const char *data)
|
||||
{
|
||||
char *params, *args, *botarg, *botcmdarg, *ircnet, *channel, *password;
|
||||
SETUP_CHANNEL_REC *rec;
|
||||
|
||||
args = "bots botcmd";
|
||||
params = cmd_get_params(data, 6 | PARAM_FLAG_MULTIARGS, &args,
|
||||
&botarg, &botcmdarg, &channel, &ircnet, &password);
|
||||
|
||||
if (*ircnet == '\0' || *channel == '\0')
|
||||
cmd_param_error(CMDERR_NOT_ENOUGH_PARAMS);
|
||||
rec = channels_setup_find(channel, ircnet);
|
||||
if (rec == NULL) {
|
||||
rec = g_new0(SETUP_CHANNEL_REC, 1);
|
||||
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);
|
||||
}
|
||||
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);
|
||||
channels_setup_create(rec);
|
||||
printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, IRCTXT_CHANSETUP_ADDED, channel, ircnet);
|
||||
|
||||
g_free(params);
|
||||
}
|
||||
|
||||
static void cmd_channel_remove(const char *data)
|
||||
{
|
||||
char *params, *ircnet, *channel;
|
||||
SETUP_CHANNEL_REC *rec;
|
||||
|
||||
params = cmd_get_params(data, 2, &channel, &ircnet);
|
||||
if (*ircnet == '\0' || *channel == '\0')
|
||||
cmd_param_error(CMDERR_NOT_ENOUGH_PARAMS);
|
||||
|
||||
rec = channels_setup_find(channel, ircnet);
|
||||
if (rec == NULL)
|
||||
printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, IRCTXT_CHANSETUP_NOT_FOUND, channel, ircnet);
|
||||
else {
|
||||
printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, IRCTXT_CHANSETUP_REMOVED, channel, ircnet);
|
||||
channels_setup_destroy(rec);
|
||||
}
|
||||
g_free(params);
|
||||
}
|
||||
|
||||
void fe_channels_init(void)
|
||||
{
|
||||
signal_add("channel created", (SIGNAL_FUNC) signal_channel_created);
|
||||
|
|
@ -109,6 +240,11 @@ 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 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);
|
||||
}
|
||||
|
||||
void fe_channels_deinit(void)
|
||||
|
|
@ -120,4 +256,9 @@ void fe_channels_deinit(void)
|
|||
signal_remove("server disconnected", (SIGNAL_FUNC) sig_disconnected);
|
||||
|
||||
command_unbind("wjoin", (SIGNAL_FUNC) cmd_wjoin);
|
||||
command_unbind("channel", (SIGNAL_FUNC) cmd_channel);
|
||||
command_unbind("channel ", (SIGNAL_FUNC) cmd_channel_list_joined);
|
||||
command_unbind("channel add", (SIGNAL_FUNC) cmd_channel_add);
|
||||
command_unbind("channel remove", (SIGNAL_FUNC) cmd_channel_remove);
|
||||
command_unbind("channel list", (SIGNAL_FUNC) cmd_channel_list);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,6 +35,9 @@ void fe_channels_deinit(void);
|
|||
void fe_irc_commands_init(void);
|
||||
void fe_irc_commands_deinit(void);
|
||||
|
||||
void fe_irc_server_init(void);
|
||||
void fe_irc_server_deinit(void);
|
||||
|
||||
void fe_ctcp_init(void);
|
||||
void fe_ctcp_deinit(void);
|
||||
|
||||
|
|
@ -53,8 +56,8 @@ void fe_ignore_deinit(void);
|
|||
void fe_query_init(void);
|
||||
void fe_query_deinit(void);
|
||||
|
||||
void irc_nick_hilight_init(void);
|
||||
void irc_nick_hilight_deinit(void);
|
||||
void irc_window_activity_init(void);
|
||||
void irc_window_activity_deinit(void);
|
||||
|
||||
void fe_notifylist_init(void);
|
||||
void fe_notifylist_deinit(void);
|
||||
|
|
@ -62,6 +65,9 @@ void fe_notifylist_deinit(void);
|
|||
void fe_flood_init(void);
|
||||
void fe_flood_deinit(void);
|
||||
|
||||
void fe_netsplit_init(void);
|
||||
void fe_netsplit_deinit(void);
|
||||
|
||||
static char *autocon_server;
|
||||
static char *autocon_password;
|
||||
static int autocon_port;
|
||||
|
|
@ -96,6 +102,7 @@ void fe_common_irc_init(void)
|
|||
|
||||
fe_channels_init();
|
||||
fe_irc_commands_init();
|
||||
fe_irc_server_init();
|
||||
fe_ctcp_init();
|
||||
fe_dcc_init();
|
||||
fe_events_init();
|
||||
|
|
@ -103,15 +110,17 @@ void fe_common_irc_init(void)
|
|||
fe_ignore_init();
|
||||
fe_notifylist_init();
|
||||
fe_flood_init();
|
||||
fe_netsplit_init();
|
||||
fe_query_init();
|
||||
completion_init();
|
||||
irc_nick_hilight_init();
|
||||
irc_window_activity_init();
|
||||
}
|
||||
|
||||
void fe_common_irc_deinit(void)
|
||||
{
|
||||
fe_channels_deinit();
|
||||
fe_irc_commands_deinit();
|
||||
fe_irc_server_deinit();
|
||||
fe_ctcp_deinit();
|
||||
fe_dcc_deinit();
|
||||
fe_events_deinit();
|
||||
|
|
@ -119,9 +128,10 @@ void fe_common_irc_deinit(void)
|
|||
fe_ignore_deinit();
|
||||
fe_notifylist_deinit();
|
||||
fe_flood_deinit();
|
||||
fe_netsplit_deinit();
|
||||
fe_query_deinit();
|
||||
completion_deinit();
|
||||
irc_nick_hilight_deinit();
|
||||
irc_window_activity_deinit();
|
||||
}
|
||||
|
||||
void fe_common_irc_finish_init(void)
|
||||
|
|
@ -162,7 +172,7 @@ void fe_common_irc_finish_init(void)
|
|||
if (*rec->ircnet != '\0')
|
||||
ircnets = g_slist_append(ircnets, rec->ircnet);
|
||||
|
||||
str = g_strdup_printf("%s %d", rec->server, rec->port);
|
||||
str = g_strdup_printf("%s %d", rec->address, rec->port);
|
||||
signal_emit("command connect", 1, str);
|
||||
g_free(str);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -607,7 +607,7 @@ static void event_motd(gchar *data, SERVER_REC *server, gchar *nick, gchar *addr
|
|||
/* numeric event. */
|
||||
gchar *params, *args, *ptr;
|
||||
|
||||
if (settings_get_bool("toggle_skip_motd"))
|
||||
if (settings_get_bool("skip_motd"))
|
||||
return;
|
||||
|
||||
params = event_get_params(data, 2 | PARAM_FLAG_GETREST, NULL, &args);
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@
|
|||
#include "query.h"
|
||||
#include "nicklist.h"
|
||||
#include "ignore.h"
|
||||
#include "netsplit.h"
|
||||
|
||||
#include "irc-hilight-text.h"
|
||||
#include "windows.h"
|
||||
|
|
@ -83,7 +84,7 @@ static void event_privmsg(gchar *data, IRC_SERVER_REC *server, gchar *nick, gcha
|
|||
color = irc_hilight_find_nick(target, nick, addr);
|
||||
|
||||
nickrec = chanrec == NULL ? NULL : nicklist_find(chanrec, nick);
|
||||
nickmode = !settings_get_bool("toggle_show_nickmode") || nickrec == NULL ? "" :
|
||||
nickmode = !settings_get_bool("show_nickmode") || nickrec == NULL ? "" :
|
||||
nickrec->op ? "@" : nickrec->voice ? "+" : " ";
|
||||
|
||||
window = chanrec == NULL ? NULL : window_item_window((WI_ITEM_REC *) chanrec);
|
||||
|
|
@ -125,7 +126,7 @@ static void event_privmsg(gchar *data, IRC_SERVER_REC *server, gchar *nick, gcha
|
|||
else
|
||||
{
|
||||
/* private message */
|
||||
if (settings_get_bool("toggle_autocreate_query") && query_find(server, nick) == NULL)
|
||||
if (settings_get_bool("autocreate_query") && query_find(server, nick) == NULL)
|
||||
item = (WI_ITEM_REC *) query_create(server, nick, TRUE);
|
||||
else
|
||||
item = (WI_ITEM_REC *) query_find(server, nick);
|
||||
|
|
@ -183,7 +184,7 @@ static void ctcp_action_msg(gchar *data, IRC_SERVER_REC *server, gchar *nick, gc
|
|||
else
|
||||
{
|
||||
/* private action */
|
||||
if (settings_get_bool("toggle_autocreate_query") && query_find(server, nick) == NULL)
|
||||
if (settings_get_bool("autocreate_query") && query_find(server, nick) == NULL)
|
||||
item = (WI_ITEM_REC *) query_create(server, nick, TRUE);
|
||||
else
|
||||
item = (WI_ITEM_REC *) channel_find(server, nick);
|
||||
|
|
@ -280,6 +281,9 @@ static void event_quit(const char *data, IRC_SERVER_REC *server, const char *nic
|
|||
if (ignore_check(server, nick, addr, NULL, data, MSGLEVEL_QUITS))
|
||||
return;
|
||||
|
||||
if (settings_get_bool("hide_netsplit_quits") && quitmsg_is_split(data))
|
||||
return;
|
||||
|
||||
print_channel = NULL;
|
||||
once = settings_get_bool("show_quit_once");
|
||||
chans = !once ? NULL : g_string_new(NULL);
|
||||
|
|
@ -558,46 +562,46 @@ static void event_ban_type_changed(gchar *bantype)
|
|||
|
||||
static void sig_server_lag_disconnected(IRC_SERVER_REC *server)
|
||||
{
|
||||
g_return_if_fail(server != NULL);
|
||||
g_return_if_fail(server != NULL);
|
||||
|
||||
printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE,
|
||||
IRCTXT_LAG_DISCONNECTED, server->connrec->address, time(NULL)-server->lag_sent);
|
||||
printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE,
|
||||
IRCTXT_LAG_DISCONNECTED, server->connrec->address, time(NULL)-server->lag_sent);
|
||||
}
|
||||
|
||||
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,
|
||||
IRCTXT_RECONNECT_REMOVED, reconnect->conn->address, reconnect->conn->port,
|
||||
reconnect->conn->ircnet == NULL ? "" : reconnect->conn->ircnet);
|
||||
printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE,
|
||||
IRCTXT_RECONNECT_REMOVED, reconnect->conn->address, reconnect->conn->port,
|
||||
reconnect->conn->ircnet == NULL ? "" : reconnect->conn->ircnet);
|
||||
}
|
||||
|
||||
static void sig_server_reconnect_not_found(gchar *tag)
|
||||
{
|
||||
g_return_if_fail(tag != NULL);
|
||||
g_return_if_fail(tag != NULL);
|
||||
|
||||
printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE,
|
||||
IRCTXT_RECONNECT_NOT_FOUND, tag);
|
||||
printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE,
|
||||
IRCTXT_RECONNECT_NOT_FOUND, tag);
|
||||
}
|
||||
|
||||
static void event_received(gchar *data, IRC_SERVER_REC *server, gchar *nick, gchar *addr)
|
||||
{
|
||||
g_return_if_fail(data != NULL);
|
||||
char *params, *cmd, *args, *ptr;
|
||||
|
||||
if (!isdigit((gint) *data))
|
||||
printtext(server, NULL, MSGLEVEL_CRAP, "%s", data);
|
||||
else
|
||||
{
|
||||
/* numeric event. */
|
||||
gchar *params, *cmd, *args, *ptr;
|
||||
g_return_if_fail(data != NULL);
|
||||
|
||||
params = event_get_params(data, 3 | PARAM_FLAG_GETREST, &cmd, NULL, &args);
|
||||
ptr = strstr(args, " :");
|
||||
if (!isdigit((gint) *data)) {
|
||||
printtext(server, NULL, MSGLEVEL_CRAP, "%s", data);
|
||||
return;
|
||||
}
|
||||
|
||||
/* numeric event. */
|
||||
params = event_get_params(data, 3 | PARAM_FLAG_GETREST, &cmd, NULL, &args);
|
||||
ptr = strstr(args, " :");
|
||||
if (ptr != NULL) *(ptr+1) = ' ';
|
||||
printtext(server, NULL, MSGLEVEL_CRAP, "%s", args);
|
||||
g_free(params);
|
||||
}
|
||||
}
|
||||
|
||||
static void sig_empty(void)
|
||||
|
|
@ -612,6 +616,7 @@ static void read_settings(void)
|
|||
|
||||
void fe_events_init(void)
|
||||
{
|
||||
settings_add_bool("misc", "hide_netsplit_quits", TRUE);
|
||||
beep_msg_level = 0;
|
||||
|
||||
read_settings();
|
||||
|
|
|
|||
|
|
@ -191,7 +191,7 @@ static void cmd_ignore(const char *data)
|
|||
else {
|
||||
key = ignore_get_key(rec);
|
||||
levels = ignore_get_levels(rec->level, rec->except_level);
|
||||
printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, IRCTXT_IGNORED, key, levels);
|
||||
printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, IRCTXT_IGNORED, key, levels);
|
||||
g_free(key);
|
||||
g_free(levels);
|
||||
}
|
||||
|
|
@ -212,7 +212,7 @@ static void cmd_unignore(const char *data)
|
|||
|
||||
if (is_numeric(data, ' ')) {
|
||||
/* with index number */
|
||||
tmp = g_slist_nth(ignores, atol(data)-1);
|
||||
tmp = g_slist_nth(ignores, atoi(data)-1);
|
||||
rec = tmp == NULL ? NULL : tmp->data;
|
||||
} else {
|
||||
/* with mask */
|
||||
|
|
|
|||
|
|
@ -28,7 +28,6 @@
|
|||
#include "levels.h"
|
||||
#include "irc.h"
|
||||
#include "server.h"
|
||||
#include "server-reconnect.h"
|
||||
#include "mode-lists.h"
|
||||
#include "nicklist.h"
|
||||
#include "channels.h"
|
||||
|
|
@ -37,66 +36,6 @@
|
|||
#include "windows.h"
|
||||
#include "window-items.h"
|
||||
|
||||
static void cmd_server(const char *data)
|
||||
{
|
||||
if (*data == '+' && data[1] != '\0')
|
||||
window_create(NULL, FALSE);
|
||||
}
|
||||
|
||||
static void print_servers(void)
|
||||
{
|
||||
GSList *tmp;
|
||||
|
||||
for (tmp = servers; tmp != NULL; tmp = tmp->next) {
|
||||
IRC_SERVER_REC *rec = tmp->data;
|
||||
|
||||
printformat(NULL, NULL, MSGLEVEL_CRAP, IRCTXT_SERVER_LIST,
|
||||
rec->tag, rec->connrec->address, rec->connrec->port,
|
||||
rec->connrec->ircnet == NULL ? "" : rec->connrec->ircnet, rec->connrec->nick);
|
||||
}
|
||||
}
|
||||
|
||||
static void print_lookup_servers(void)
|
||||
{
|
||||
GSList *tmp;
|
||||
for (tmp = lookup_servers; tmp != NULL; tmp = tmp->next) {
|
||||
IRC_SERVER_REC *rec = tmp->data;
|
||||
|
||||
printformat(NULL, NULL, MSGLEVEL_CRAP, IRCTXT_SERVER_LOOKUP_LIST,
|
||||
rec->tag, rec->connrec->address, rec->connrec->port,
|
||||
rec->connrec->ircnet == NULL ? "" : rec->connrec->ircnet, rec->connrec->nick);
|
||||
}
|
||||
}
|
||||
|
||||
static void print_reconnects(void)
|
||||
{
|
||||
GSList *tmp;
|
||||
char *tag, *next_connect;
|
||||
int left;
|
||||
|
||||
for (tmp = reconnects; tmp != NULL; tmp = tmp->next) {
|
||||
RECONNECT_REC *rec = tmp->data;
|
||||
IRC_SERVER_CONNECT_REC *conn = rec->conn;
|
||||
|
||||
tag = g_strdup_printf("RECON-%d", rec->tag);
|
||||
left = rec->next_connect-time(NULL);
|
||||
next_connect = g_strdup_printf("%02d:%02d", left/60, left%60);
|
||||
printformat(NULL, NULL, MSGLEVEL_CRAP, IRCTXT_SERVER_RECONNECT_LIST,
|
||||
tag, conn->address, conn->port,
|
||||
conn->ircnet == NULL ? "" : conn->ircnet,
|
||||
conn->nick, next_connect);
|
||||
g_free(next_connect);
|
||||
g_free(tag);
|
||||
}
|
||||
}
|
||||
|
||||
static void cmd_servers(void)
|
||||
{
|
||||
print_servers();
|
||||
print_lookup_servers();
|
||||
print_reconnects();
|
||||
}
|
||||
|
||||
static void cmd_unquery(const char *data, IRC_SERVER_REC *server, WI_IRC_REC *item)
|
||||
{
|
||||
QUERY_REC *query;
|
||||
|
|
@ -196,7 +135,7 @@ static void cmd_msg(gchar *data, IRC_SERVER_REC *server, WI_ITEM_REC *item)
|
|||
{
|
||||
/* msg to channel */
|
||||
nickrec = channel == NULL ? NULL : nicklist_find(channel, server->nick);
|
||||
nickmode = !settings_get_bool("toggle_show_nickmode") || nickrec == NULL ? "" :
|
||||
nickmode = !settings_get_bool("show_nickmode") || nickrec == NULL ? "" :
|
||||
nickrec->op ? "@" : nickrec->voice ? "+" : " ";
|
||||
|
||||
window = channel == NULL ? NULL : window_item_window((WI_ITEM_REC *) channel);
|
||||
|
|
@ -329,8 +268,8 @@ static void cmd_ban(const char *data, IRC_SERVER_REC *server, WI_IRC_REC *item)
|
|||
GSList *tmp;
|
||||
|
||||
g_return_if_fail(data != NULL);
|
||||
if (*data == '\0')
|
||||
return; /* setting ban - don't handle here */
|
||||
if (*data != '\0')
|
||||
return; /* setting ban - don't handle here */
|
||||
|
||||
if (server == NULL || !server->connected) cmd_return_error(CMDERR_NOT_CONNECTED);
|
||||
|
||||
|
|
@ -415,52 +354,6 @@ static void cmd_join(const char *data, IRC_SERVER_REC *server)
|
|||
}
|
||||
}
|
||||
|
||||
static void cmd_channel(const char *data, IRC_SERVER_REC *server)
|
||||
{
|
||||
CHANNEL_REC *channel;
|
||||
GString *nicks;
|
||||
GSList *nicklist, *tmp, *ntmp;
|
||||
char *mode;
|
||||
|
||||
if (*data != '\0') {
|
||||
cmd_join(data, server);
|
||||
return;
|
||||
}
|
||||
|
||||
if (channels == NULL) {
|
||||
printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, IRCTXT_NOT_IN_CHANNELS);
|
||||
return;
|
||||
}
|
||||
|
||||
/* print active channel */
|
||||
channel = irc_item_channel(active_win->active);
|
||||
if (channel != NULL)
|
||||
printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, IRCTXT_CURRENT_CHANNEL, channel->name);
|
||||
|
||||
/* print list of all channels, their modes, server tags and nicks */
|
||||
printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, IRCTXT_CHANLIST_HEADER);
|
||||
for (tmp = channels; tmp != NULL; tmp = tmp->next) {
|
||||
channel = tmp->data;
|
||||
|
||||
nicklist = nicklist_getnicks(channel);
|
||||
mode = channel_get_mode(channel);
|
||||
nicks = g_string_new(NULL);
|
||||
for (ntmp = nicklist; ntmp != NULL; ntmp = ntmp->next) {
|
||||
NICK_REC *rec = ntmp->data;
|
||||
|
||||
g_string_sprintfa(nicks, "%s ", rec->nick);
|
||||
}
|
||||
|
||||
g_string_truncate(nicks, nicks->len-1);
|
||||
printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, IRCTXT_CHANLIST_LINE,
|
||||
channel->name, mode, channel->server->tag, nicks->str);
|
||||
|
||||
g_free(mode);
|
||||
g_slist_free(nicklist);
|
||||
g_string_free(nicks, TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
static void cmd_nick(const char *data, IRC_SERVER_REC *server)
|
||||
{
|
||||
g_return_if_fail(data != NULL);
|
||||
|
|
@ -506,8 +399,6 @@ static void cmd_ts(const char *data)
|
|||
|
||||
void fe_irc_commands_init(void)
|
||||
{
|
||||
command_bind("server", NULL, (SIGNAL_FUNC) cmd_server);
|
||||
command_bind("servers", NULL, (SIGNAL_FUNC) cmd_servers);
|
||||
command_bind("query", NULL, (SIGNAL_FUNC) cmd_query);
|
||||
command_bind("unquery", NULL, (SIGNAL_FUNC) cmd_unquery);
|
||||
command_bind("msg", NULL, (SIGNAL_FUNC) cmd_msg);
|
||||
|
|
@ -519,7 +410,6 @@ void fe_irc_commands_init(void)
|
|||
command_bind("ban", NULL, (SIGNAL_FUNC) cmd_ban);
|
||||
command_bind("invitelist", NULL, (SIGNAL_FUNC) cmd_invitelist);
|
||||
command_bind("join", NULL, (SIGNAL_FUNC) cmd_join);
|
||||
command_bind("channel", NULL, (SIGNAL_FUNC) cmd_channel);
|
||||
command_bind("nick", NULL, (SIGNAL_FUNC) cmd_nick);
|
||||
command_bind("ver", NULL, (SIGNAL_FUNC) cmd_ver);
|
||||
command_bind("ts", NULL, (SIGNAL_FUNC) cmd_ts);
|
||||
|
|
@ -527,8 +417,6 @@ void fe_irc_commands_init(void)
|
|||
|
||||
void fe_irc_commands_deinit(void)
|
||||
{
|
||||
command_unbind("server", (SIGNAL_FUNC) cmd_server);
|
||||
command_unbind("servers", (SIGNAL_FUNC) cmd_servers);
|
||||
command_unbind("query", (SIGNAL_FUNC) cmd_query);
|
||||
command_unbind("unquery", (SIGNAL_FUNC) cmd_unquery);
|
||||
command_unbind("msg", (SIGNAL_FUNC) cmd_msg);
|
||||
|
|
@ -540,7 +428,6 @@ void fe_irc_commands_deinit(void)
|
|||
command_unbind("ban", (SIGNAL_FUNC) cmd_ban);
|
||||
command_unbind("invitelist", (SIGNAL_FUNC) cmd_invitelist);
|
||||
command_unbind("join", (SIGNAL_FUNC) cmd_join);
|
||||
command_unbind("channel", (SIGNAL_FUNC) cmd_channel);
|
||||
command_unbind("nick", (SIGNAL_FUNC) cmd_nick);
|
||||
command_unbind("ver", (SIGNAL_FUNC) cmd_ver);
|
||||
command_unbind("ts", (SIGNAL_FUNC) cmd_ts);
|
||||
|
|
|
|||
215
src/fe-common/irc/fe-irc-server.c
Normal file
215
src/fe-common/irc/fe-irc-server.c
Normal file
|
|
@ -0,0 +1,215 @@
|
|||
/*
|
||||
fe-irc-server.c : irssi
|
||||
|
||||
Copyright (C) 1999-2000 Timo Sirainen
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include "module.h"
|
||||
#include "module-formats.h"
|
||||
#include "signals.h"
|
||||
#include "commands.h"
|
||||
#include "misc.h"
|
||||
|
||||
#include "levels.h"
|
||||
#include "irc-server.h"
|
||||
#include "server-reconnect.h"
|
||||
#include "server-setup.h"
|
||||
|
||||
#include "windows.h"
|
||||
|
||||
static void print_servers(void)
|
||||
{
|
||||
GSList *tmp;
|
||||
|
||||
for (tmp = servers; tmp != NULL; tmp = tmp->next) {
|
||||
IRC_SERVER_REC *rec = tmp->data;
|
||||
|
||||
printformat(NULL, NULL, MSGLEVEL_CRAP, IRCTXT_SERVER_LIST,
|
||||
rec->tag, rec->connrec->address, rec->connrec->port,
|
||||
rec->connrec->ircnet == NULL ? "" : rec->connrec->ircnet, rec->connrec->nick);
|
||||
}
|
||||
}
|
||||
|
||||
static void print_lookup_servers(void)
|
||||
{
|
||||
GSList *tmp;
|
||||
for (tmp = lookup_servers; tmp != NULL; tmp = tmp->next) {
|
||||
IRC_SERVER_REC *rec = tmp->data;
|
||||
|
||||
printformat(NULL, NULL, MSGLEVEL_CRAP, IRCTXT_SERVER_LOOKUP_LIST,
|
||||
rec->tag, rec->connrec->address, rec->connrec->port,
|
||||
rec->connrec->ircnet == NULL ? "" : rec->connrec->ircnet, rec->connrec->nick);
|
||||
}
|
||||
}
|
||||
|
||||
static void print_reconnects(void)
|
||||
{
|
||||
GSList *tmp;
|
||||
char *tag, *next_connect;
|
||||
int left;
|
||||
|
||||
for (tmp = reconnects; tmp != NULL; tmp = tmp->next) {
|
||||
RECONNECT_REC *rec = tmp->data;
|
||||
IRC_SERVER_CONNECT_REC *conn = rec->conn;
|
||||
|
||||
tag = g_strdup_printf("RECON-%d", rec->tag);
|
||||
left = rec->next_connect-time(NULL);
|
||||
next_connect = g_strdup_printf("%02d:%02d", left/60, left%60);
|
||||
printformat(NULL, NULL, MSGLEVEL_CRAP, IRCTXT_SERVER_RECONNECT_LIST,
|
||||
tag, conn->address, conn->port,
|
||||
conn->ircnet == NULL ? "" : conn->ircnet,
|
||||
conn->nick, next_connect);
|
||||
g_free(next_connect);
|
||||
g_free(tag);
|
||||
}
|
||||
}
|
||||
|
||||
static void server_add(const char *data)
|
||||
{
|
||||
SETUP_SERVER_REC *rec;
|
||||
char *params, *args, *ircnet, *host, *cmdspeed, *cmdmax;
|
||||
char *addr, *portstr, *password, *nick;
|
||||
int port;
|
||||
|
||||
args = "ircnet host cmdspeed cmdmax";
|
||||
params = cmd_get_params(data, 9 | PARAM_FLAG_MULTIARGS,
|
||||
&args, &ircnet, &host, &cmdspeed, &cmdmax,
|
||||
&addr, &portstr, &password, &nick);
|
||||
if (*addr == '\0') cmd_param_error(CMDERR_NOT_ENOUGH_PARAMS);
|
||||
port = *portstr == '\0' ? 6667 : atoi(portstr);
|
||||
|
||||
rec = server_setup_find(addr, port);
|
||||
if (rec == NULL) {
|
||||
rec = g_new0(SETUP_SERVER_REC, 1);
|
||||
rec->address = g_strdup(addr);
|
||||
rec->port = port;
|
||||
} else {
|
||||
g_free_and_null(rec->ircnet);
|
||||
g_free_and_null(rec->password);
|
||||
g_free_and_null(rec->own_host);
|
||||
}
|
||||
|
||||
rec->autoconnect = stristr(args, "-auto") != NULL;
|
||||
if (*ircnet != '\0') rec->ircnet = g_strdup(ircnet);
|
||||
if (*password != '\0') rec->password = g_strdup(password);
|
||||
if (*host != '\0') rec->own_host = g_strdup(host);
|
||||
rec->cmd_queue_speed = atoi(cmdspeed);
|
||||
rec->max_cmds_at_once = atoi(cmdmax);
|
||||
|
||||
server_setup_add(rec);
|
||||
printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, IRCTXT_SETUPSERVER_ADDED, addr, port);
|
||||
|
||||
g_free(params);
|
||||
}
|
||||
|
||||
static void server_remove(const char *data)
|
||||
{
|
||||
SETUP_SERVER_REC *rec;
|
||||
char *params, *args, *addr, *portstr;
|
||||
int port;
|
||||
|
||||
params = cmd_get_params(data, 3 | PARAM_FLAG_OPTARGS, &args, &addr, &portstr);
|
||||
if (*addr == '\0') cmd_param_error(CMDERR_NOT_ENOUGH_PARAMS);
|
||||
port = *portstr == '\0' ? 6667 : atoi(portstr);
|
||||
|
||||
rec = server_setup_find(addr, port);
|
||||
if (rec == NULL)
|
||||
printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, IRCTXT_SETUPSERVER_NOT_FOUND, addr, port);
|
||||
else {
|
||||
server_setup_remove(rec);
|
||||
printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, IRCTXT_SETUPSERVER_REMOVED, addr, port);
|
||||
}
|
||||
|
||||
g_free(params);
|
||||
}
|
||||
|
||||
static void server_list(const char *data)
|
||||
{
|
||||
GString *str;
|
||||
GSList *tmp;
|
||||
|
||||
str = g_string_new(NULL);
|
||||
printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, IRCTXT_SETUPSERVER_HEADER);
|
||||
for (tmp = setupservers; tmp != NULL; tmp = tmp->next) {
|
||||
SETUP_SERVER_REC *rec = tmp->data;
|
||||
|
||||
g_string_truncate(str, 0);
|
||||
if (rec->password != NULL)
|
||||
g_string_append(str, "(pass) ");
|
||||
if (rec->autoconnect)
|
||||
g_string_append(str, "autoconnect ");
|
||||
if (rec->max_cmds_at_once > 0)
|
||||
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);
|
||||
if (rec->own_host != NULL)
|
||||
g_string_sprintfa(str, "host: %s ", rec->own_host);
|
||||
printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, IRCTXT_SETUPSERVER_LINE,
|
||||
rec->address, rec->port,
|
||||
rec->ircnet == NULL ? "" : rec->ircnet,
|
||||
str->str);
|
||||
}
|
||||
printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, IRCTXT_SETUPSERVER_FOOTER);
|
||||
g_string_free(str, TRUE);
|
||||
}
|
||||
|
||||
static void cmd_server(const char *data)
|
||||
{
|
||||
char *params, *args, *ircnetarg, *hostarg, *addr;
|
||||
|
||||
if (*data == '\0') {
|
||||
print_servers();
|
||||
print_lookup_servers();
|
||||
print_reconnects();
|
||||
|
||||
signal_stop();
|
||||
return;
|
||||
}
|
||||
|
||||
args = "ircnet host";
|
||||
params = cmd_get_params(data, 4 | PARAM_FLAG_MULTIARGS,
|
||||
&args, &ircnetarg, &hostarg, &addr);
|
||||
|
||||
if (stristr(args, "-list") != NULL) {
|
||||
server_list(data);
|
||||
signal_stop();
|
||||
} else if (stristr(args, "-add") != NULL) {
|
||||
if (*addr == '\0') cmd_param_error(CMDERR_NOT_ENOUGH_PARAMS);
|
||||
server_add(data);
|
||||
signal_stop();
|
||||
} else if (stristr(args, "-remove") != NULL) {
|
||||
if (*addr == '\0') cmd_param_error(CMDERR_NOT_ENOUGH_PARAMS);
|
||||
server_remove(data);
|
||||
signal_stop();
|
||||
} else {
|
||||
if (*addr == '\0' || strcmp(addr, "+") == 0)
|
||||
cmd_param_error(CMDERR_NOT_ENOUGH_PARAMS);
|
||||
if (*addr == '+') window_create(NULL, FALSE);
|
||||
}
|
||||
|
||||
g_free(params);
|
||||
}
|
||||
|
||||
void fe_irc_server_init(void)
|
||||
{
|
||||
command_bind("server", NULL, (SIGNAL_FUNC) cmd_server);
|
||||
}
|
||||
|
||||
void fe_irc_server_deinit(void)
|
||||
{
|
||||
command_unbind("server", (SIGNAL_FUNC) cmd_server);
|
||||
}
|
||||
69
src/fe-common/irc/fe-netsplit.c
Normal file
69
src/fe-common/irc/fe-netsplit.c
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
/*
|
||||
fe-netsplit.c : irssi
|
||||
|
||||
Copyright (C) 2000 Timo Sirainen
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include "module.h"
|
||||
#include "module-formats.h"
|
||||
#include "signals.h"
|
||||
#include "commands.h"
|
||||
|
||||
#include "levels.h"
|
||||
#include "netsplit.h"
|
||||
|
||||
static void sig_netsplit_servers(NETSPLIT_SERVER_REC *rec)
|
||||
{
|
||||
printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, IRCTXT_NETSPLIT, rec->server, rec->destserver);
|
||||
}
|
||||
|
||||
static void split_print(const char *nick, NETSPLIT_REC *rec)
|
||||
{
|
||||
NETSPLIT_CHAN_REC *chan;
|
||||
|
||||
chan = rec->channels->data;
|
||||
printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, IRCTXT_NETSPLITS_LINE,
|
||||
rec->nick, chan == NULL ? "" : chan->name,
|
||||
rec->server->server, rec->server->destserver);
|
||||
}
|
||||
|
||||
static void cmd_netsplit(const char *data, IRC_SERVER_REC *server)
|
||||
{
|
||||
if (server == NULL || !server->connected)
|
||||
cmd_return_error(CMDERR_NOT_CONNECTED);
|
||||
|
||||
if (server->split_servers == NULL) {
|
||||
printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, IRCTXT_NO_NETSPLITS);
|
||||
return;
|
||||
}
|
||||
|
||||
printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, IRCTXT_NETSPLITS_HEADER);
|
||||
g_hash_table_foreach(server->splits, (GHFunc) split_print, NULL);
|
||||
printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, IRCTXT_NETSPLITS_FOOTER);
|
||||
}
|
||||
|
||||
void fe_netsplit_init(void)
|
||||
{
|
||||
signal_add("netsplit new server", (SIGNAL_FUNC) sig_netsplit_servers);
|
||||
command_bind("netsplit", NULL, (SIGNAL_FUNC) cmd_netsplit);
|
||||
}
|
||||
|
||||
void fe_netsplit_deinit(void)
|
||||
{
|
||||
signal_remove("netsplit new server", (SIGNAL_FUNC) sig_netsplit_servers);
|
||||
command_unbind("netsplit", (SIGNAL_FUNC) cmd_netsplit);
|
||||
}
|
||||
|
|
@ -23,6 +23,7 @@
|
|||
#include "modules.h"
|
||||
#include "signals.h"
|
||||
#include "commands.h"
|
||||
#include "settings.h"
|
||||
|
||||
#include "irc.h"
|
||||
#include "levels.h"
|
||||
|
|
@ -31,6 +32,8 @@
|
|||
#include "windows.h"
|
||||
#include "window-items.h"
|
||||
|
||||
static int queryclose_tag, query_auto_close;
|
||||
|
||||
static void signal_query_created(QUERY_REC *query, gpointer automatic)
|
||||
{
|
||||
window_item_create((WI_ITEM_REC *) query, GPOINTER_TO_INT(automatic));
|
||||
|
|
@ -110,12 +113,67 @@ static void cmd_wquery(const char *data, void *server, WI_ITEM_REC *item)
|
|||
signal_remove("query created", (SIGNAL_FUNC) signal_query_created_curwin);
|
||||
}
|
||||
|
||||
static void sig_window_changed(WINDOW_REC *window)
|
||||
{
|
||||
GSList *tmp;
|
||||
|
||||
if (query_auto_close <= 0)
|
||||
return;
|
||||
|
||||
for (tmp = window->items; tmp != NULL; tmp = tmp->next) {
|
||||
if (irc_item_query(tmp->data))
|
||||
break;
|
||||
}
|
||||
if (tmp == NULL) return; /* no queries in window */
|
||||
|
||||
/* reset the window's last_line timestamp so that query doesn't get
|
||||
closed immediately after switched to the window. */
|
||||
window->last_line = time(NULL);
|
||||
}
|
||||
|
||||
static int sig_query_autoclose(void)
|
||||
{
|
||||
WINDOW_REC *window;
|
||||
GSList *tmp, *next;
|
||||
time_t now;
|
||||
|
||||
now = time(NULL);
|
||||
for (tmp = queries; tmp != NULL; tmp = next) {
|
||||
QUERY_REC *rec = tmp->data;
|
||||
|
||||
next = tmp->next;
|
||||
window = window_item_window((WI_ITEM_REC *) rec);
|
||||
if (window != active_win && rec->new_data == 0 &&
|
||||
now-window->last_line > query_auto_close)
|
||||
query_destroy(rec);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void read_settings(void)
|
||||
{
|
||||
query_auto_close = settings_get_int("query_auto_close");
|
||||
if (query_auto_close > 0 && queryclose_tag == -1)
|
||||
queryclose_tag = g_timeout_add(5000, (GSourceFunc) sig_query_autoclose, NULL);
|
||||
else if (query_auto_close <= 0 && queryclose_tag != -1) {
|
||||
g_source_remove(queryclose_tag);
|
||||
queryclose_tag = -1;
|
||||
}
|
||||
}
|
||||
|
||||
void fe_query_init(void)
|
||||
{
|
||||
settings_add_int("lookandfeel", "query_auto_close", 0);
|
||||
|
||||
queryclose_tag = -1;
|
||||
read_settings();
|
||||
|
||||
signal_add("query created", (SIGNAL_FUNC) signal_query_created);
|
||||
signal_add("query destroyed", (SIGNAL_FUNC) signal_query_destroyed);
|
||||
signal_add("window item remove", (SIGNAL_FUNC) signal_window_item_removed);
|
||||
signal_add("server connected", (SIGNAL_FUNC) sig_server_connected);
|
||||
signal_add("window changed", (SIGNAL_FUNC) sig_window_changed);
|
||||
signal_add("setup changed", (SIGNAL_FUNC) read_settings);
|
||||
|
||||
command_bind("wquery", NULL, (SIGNAL_FUNC) cmd_wquery);
|
||||
command_bind("window server", NULL, (SIGNAL_FUNC) cmd_window_server);
|
||||
|
|
@ -123,10 +181,14 @@ void fe_query_init(void)
|
|||
|
||||
void fe_query_deinit(void)
|
||||
{
|
||||
if (queryclose_tag != -1) g_source_remove(queryclose_tag);
|
||||
|
||||
signal_remove("query created", (SIGNAL_FUNC) signal_query_created);
|
||||
signal_remove("query destroyed", (SIGNAL_FUNC) signal_query_destroyed);
|
||||
signal_remove("window item remove", (SIGNAL_FUNC) signal_window_item_removed);
|
||||
signal_remove("server connected", (SIGNAL_FUNC) sig_server_connected);
|
||||
signal_remove("window changed", (SIGNAL_FUNC) sig_window_changed);
|
||||
signal_remove("setup changed", (SIGNAL_FUNC) read_settings);
|
||||
|
||||
command_unbind("wquery", (SIGNAL_FUNC) cmd_wquery);
|
||||
command_unbind("window server", (SIGNAL_FUNC) cmd_window_server);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
irc-nick-hilight.c : irssi
|
||||
irc-window-activity.c : irssi
|
||||
|
||||
Copyright (C) 1999-2000 Timo Sirainen
|
||||
|
||||
|
|
@ -78,12 +78,12 @@ static void event_privmsg(const char *data, IRC_SERVER_REC *server, const char *
|
|||
g_free(params);
|
||||
}
|
||||
|
||||
void irc_nick_hilight_init(void)
|
||||
void irc_window_activity_init(void)
|
||||
{
|
||||
signal_add_last("event privmsg", (SIGNAL_FUNC) event_privmsg);
|
||||
}
|
||||
|
||||
void irc_nick_hilight_deinit(void)
|
||||
void irc_window_activity_deinit(void)
|
||||
{
|
||||
signal_remove("event privmsg", (SIGNAL_FUNC) event_privmsg);
|
||||
}
|
||||
|
|
@ -36,6 +36,17 @@ FORMAT_REC fecommon_irc_formats[] =
|
|||
{ "server_reconnect_removed", "Removed reconnection to server %_$0%_ port %_$1%_", 3, { 0, 1, 0 } },
|
||||
{ "server_reconnect_not_found", "Reconnection tag %_$0%_ not found", 1, { 0 } },
|
||||
{ "query_server_changed", "Query with %_$2%_ changed to server %_$1%_", 3, { 0, 0, 0 } },
|
||||
{ "setupserver_added", "Server $0 saved", 2, { 0, 0 } },
|
||||
{ "setupserver_removed", "Server $0 removed", 2, { 0, 0 } },
|
||||
{ "setupserver_not_found", "Server $0 not found", 2, { 0, 0 } },
|
||||
{ "setupserver_header", "Server Port IRC Net Settings", 0 },
|
||||
{ "setupserver_line", "%|$[!20]0 $[5]1 $[10]2 $3", 4, { 0, 1, 0, 0 } },
|
||||
{ "setupserver_footer", "", 0 },
|
||||
{ "netsplit", "%RNetsplit%n detected between servers %_$0%_ and %_$1%_%:Use /NETSPLIT to see who left", 2, { 0, 0 } },
|
||||
{ "no_netsplits", "There are no net splits", 0 },
|
||||
{ "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 },
|
||||
|
||||
/* ---- */
|
||||
{ NULL, "Channels", 0 },
|
||||
|
|
@ -73,11 +84,17 @@ FORMAT_REC fecommon_irc_formats[] =
|
|||
{ "ebanlist_long", "%_$0%_: ban exception %c$1 %K[%nby %_$2%_, $3 secs ago%K]", 4, { 0, 0, 0, 1 } },
|
||||
{ "invitelist", "%_$0%_: invite %c$1", 2, { 0, 0 } },
|
||||
{ "no_such_channel", "$0: No such channel", 1, { 0 } },
|
||||
{ "channel_synced", "Join to %_$0%_ was synced in %_$1%_ secs", 2, { 0, 2 } },
|
||||
{ "not_in_channels", "You are not on any channels", 0 },
|
||||
{ "current_channel", "Current channel $0", 1, { 0 } },
|
||||
{ "chanlist_header", "You are on the following channels:", 0 },
|
||||
{ "chanlist_line", "$[-10]0 %|+$1 ($2): $3", 4, { 0, 0, 0, 0 } },
|
||||
{ "channel_synced", "Join to %_$0%_ was synced in %_$1%_ secs", 2, { 0, 2 } },
|
||||
{ "chansetup_not_found", "Channel $0 not found", 2, { 0, 0 } },
|
||||
{ "chansetup_added", "Channel $0 saved", 2, { 0, 0 } },
|
||||
{ "chansetup_removed", "Channel $0 removed", 2, { 0, 0 } },
|
||||
{ "chansetup_header", "Channel IRC net Password Settings", 0 },
|
||||
{ "chansetup_line", "$[15]0 %|$[10]1 $[10]2 $3", 4, { 0, 0, 0, 0 } },
|
||||
{ "chansetup_footer", "", 0 },
|
||||
|
||||
/* ---- */
|
||||
{ NULL, "Nick", 0 },
|
||||
|
|
|
|||
|
|
@ -13,6 +13,17 @@ enum {
|
|||
IRCTXT_RECONNECT_REMOVED,
|
||||
IRCTXT_RECONNECT_NOT_FOUND,
|
||||
IRCTXT_QUERY_SERVER_CHANGED,
|
||||
IRCTXT_SETUPSERVER_ADDED,
|
||||
IRCTXT_SETUPSERVER_REMOVED,
|
||||
IRCTXT_SETUPSERVER_NOT_FOUND,
|
||||
IRCTXT_SETUPSERVER_HEADER,
|
||||
IRCTXT_SETUPSERVER_LINE,
|
||||
IRCTXT_SETUPSERVER_FOOTER,
|
||||
IRCTXT_NETSPLIT,
|
||||
IRCTXT_NO_NETSPLITS,
|
||||
IRCTXT_NETSPLITS_HEADER,
|
||||
IRCTXT_NETSPLITS_LINE,
|
||||
IRCTXT_NETSPLITS_FOOTER,
|
||||
|
||||
IRCTXT_FILL_2,
|
||||
|
||||
|
|
@ -49,11 +60,17 @@ enum {
|
|||
IRCTXT_EBANLIST_LONG,
|
||||
IRCTXT_INVITELIST,
|
||||
IRCTXT_NO_SUCH_CHANNEL,
|
||||
IRCTXT_CHANNEL_SYNCED,
|
||||
IRCTXT_NOT_IN_CHANNELS,
|
||||
IRCTXT_CURRENT_CHANNEL,
|
||||
IRCTXT_CHANLIST_HEADER,
|
||||
IRCTXT_CHANLIST_LINE,
|
||||
IRCTXT_CHANNEL_SYNCED,
|
||||
IRCTXT_CHANSETUP_NOT_FOUND,
|
||||
IRCTXT_CHANSETUP_ADDED,
|
||||
IRCTXT_CHANSETUP_REMOVED,
|
||||
IRCTXT_CHANSETUP_HEADER,
|
||||
IRCTXT_CHANSETUP_LINE,
|
||||
IRCTXT_CHANSETUP_FOOTER,
|
||||
|
||||
IRCTXT_FILL_4,
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue