forked from PsychoticNinja/irssi
Execute ~/.irssi/startup before autoconnecting to servers. This way you can
get autoconnecting work with dynamically loaded chat protocols. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2062 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
8e20972f4f
commit
7433dafcb1
@ -39,6 +39,7 @@ libfe_common_core_a_SOURCES = \
|
|||||||
fe-windows.c
|
fe-windows.c
|
||||||
|
|
||||||
noinst_HEADERS = \
|
noinst_HEADERS = \
|
||||||
|
autorun.h \
|
||||||
command-history.h \
|
command-history.h \
|
||||||
chat-completion.h \
|
chat-completion.h \
|
||||||
completion.h \
|
completion.h \
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
autorun.c : irssi
|
autorun.c : irssi
|
||||||
|
|
||||||
Copyright (C) 1999-2000 Timo Sirainen
|
Copyright (C) 1999-2001 Timo Sirainen
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
@ -25,7 +25,7 @@
|
|||||||
|
|
||||||
#include "fe-windows.h"
|
#include "fe-windows.h"
|
||||||
|
|
||||||
static void sig_autorun(void)
|
void autorun_startup(void)
|
||||||
{
|
{
|
||||||
char tmpbuf[1024], *str, *path;
|
char tmpbuf[1024], *str, *path;
|
||||||
LINEBUF_REC *buffer = NULL;
|
LINEBUF_REC *buffer = NULL;
|
||||||
@ -44,19 +44,13 @@ static void sig_autorun(void)
|
|||||||
recvlen = read(f, tmpbuf, sizeof(tmpbuf));
|
recvlen = read(f, tmpbuf, sizeof(tmpbuf));
|
||||||
|
|
||||||
ret = line_split(tmpbuf, recvlen, &str, &buffer);
|
ret = line_split(tmpbuf, recvlen, &str, &buffer);
|
||||||
if (ret > 0) eval_special_string(str, "", active_win->active_server, active_win->active);
|
if (ret > 0) {
|
||||||
|
eval_special_string(str, "",
|
||||||
|
active_win->active_server,
|
||||||
|
active_win->active);
|
||||||
|
}
|
||||||
} while (ret > 0);
|
} while (ret > 0);
|
||||||
line_split_free(buffer);
|
line_split_free(buffer);
|
||||||
|
|
||||||
close(f);
|
close(f);
|
||||||
}
|
}
|
||||||
|
|
||||||
void autorun_init(void)
|
|
||||||
{
|
|
||||||
signal_add_last("irssi init finished", (SIGNAL_FUNC) sig_autorun);
|
|
||||||
}
|
|
||||||
|
|
||||||
void autorun_deinit(void)
|
|
||||||
{
|
|
||||||
signal_remove("irssi init finished", (SIGNAL_FUNC) sig_autorun);
|
|
||||||
}
|
|
||||||
|
6
src/fe-common/core/autorun.h
Normal file
6
src/fe-common/core/autorun.h
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
#ifndef __AUTORUN_H
|
||||||
|
#define __AUTORUN_H
|
||||||
|
|
||||||
|
void autorun_startup(void);
|
||||||
|
|
||||||
|
#endif
|
@ -29,6 +29,7 @@
|
|||||||
#include "channels.h"
|
#include "channels.h"
|
||||||
#include "servers-setup.h"
|
#include "servers-setup.h"
|
||||||
|
|
||||||
|
#include "autorun.h"
|
||||||
#include "fe-queries.h"
|
#include "fe-queries.h"
|
||||||
#include "hilight-text.h"
|
#include "hilight-text.h"
|
||||||
#include "command-history.h"
|
#include "command-history.h"
|
||||||
@ -52,9 +53,6 @@ static int no_autoconnect;
|
|||||||
static char *cmdline_nick;
|
static char *cmdline_nick;
|
||||||
static char *cmdline_hostname;
|
static char *cmdline_hostname;
|
||||||
|
|
||||||
void autorun_init(void);
|
|
||||||
void autorun_deinit(void);
|
|
||||||
|
|
||||||
void fe_core_log_init(void);
|
void fe_core_log_init(void);
|
||||||
void fe_core_log_deinit(void);
|
void fe_core_log_deinit(void);
|
||||||
|
|
||||||
@ -171,7 +169,6 @@ void fe_common_core_init(void)
|
|||||||
themes_init();
|
themes_init();
|
||||||
theme_register(fecommon_core_formats);
|
theme_register(fecommon_core_formats);
|
||||||
|
|
||||||
autorun_init();
|
|
||||||
command_history_init();
|
command_history_init();
|
||||||
completion_init();
|
completion_init();
|
||||||
keyboard_init();
|
keyboard_init();
|
||||||
@ -214,7 +211,6 @@ void fe_common_core_init(void)
|
|||||||
|
|
||||||
void fe_common_core_deinit(void)
|
void fe_common_core_deinit(void)
|
||||||
{
|
{
|
||||||
autorun_deinit();
|
|
||||||
hilight_text_deinit();
|
hilight_text_deinit();
|
||||||
command_history_deinit();
|
command_history_deinit();
|
||||||
completion_deinit();
|
completion_deinit();
|
||||||
@ -380,5 +376,6 @@ void fe_common_core_finish_init(void)
|
|||||||
if (setup_changed)
|
if (setup_changed)
|
||||||
signal_emit("setup changed", 0);
|
signal_emit("setup changed", 0);
|
||||||
|
|
||||||
|
autorun_startup();
|
||||||
autoconnect_servers();
|
autoconnect_servers();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user