Added bot plugin, it also has almost-functional botnet.

Changed configure.in's functionality so that you could tell what modules you
want to build in main irssi binary and it will create automatically the .c
files that need to call the module_init()/deinit() functions.

Fixed several minor things..


git-svn-id: http://svn.irssi.org/repos/irssi/trunk@230 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2000-05-25 11:30:47 +00:00 committed by cras
commit 76605ad0ae
41 changed files with 2809 additions and 246 deletions

View file

@ -41,7 +41,6 @@ noinst_HEADERS = \
channels-setup.h \
ignore.h \
irc.h \
irc-core.h \
irc-server.h \
ircnet-setup.h \
masks.h \

View file

@ -70,7 +70,7 @@ static IRC_SERVER_REC *connect_server(const char *data)
if (*host != '\0') {
IPADDR ip;
if (net_gethostname(host, &ip) == 0) {
if (net_gethostbyname(host, &ip) == 0) {
if (conn->own_ip == NULL)
conn->own_ip = g_new(IPADDR, 1);
memcpy(conn->own_ip, &ip, sizeof(IPADDR));

View file

@ -1,7 +0,0 @@
#ifndef __IRC_CORE_H
#define __IRC_CORE_H
void irc_core_init(void);
void irc_core_deinit(void);
#endif

View file

@ -23,6 +23,7 @@
#include "signals.h"
#include "irc.h"
#include "modes.h"
#include "mode-lists.h"
#include "nicklist.h"
@ -322,9 +323,6 @@ void channel_set_singlemode(IRC_SERVER_REC *server, const char *channel, const c
g_string_free(str, TRUE);
}
#define MODE_HAS_ARG(c) ((c) == 'b' || (c) == 'e' || (c) == 'I' || \
(c) == 'v' || (c) == 'o' || (c) == 'l' || (c) == 'k')
void channel_set_mode(IRC_SERVER_REC *server, const char *channel, const char *mode)
{
char *modestr, *curmode, *orig;
@ -343,7 +341,7 @@ void channel_set_mode(IRC_SERVER_REC *server, const char *channel, const char *m
curmode = cmd_get_param(&modestr);
for (; *curmode != '\0'; curmode++) {
if (count == server->connrec->max_modes && MODE_HAS_ARG(*curmode)) {
if (count == server->connrec->max_modes && HAS_MODE_ARG(*curmode)) {
irc_send_cmdv(server, "MODE %s %s%s", channel, tmode->str, targs->str);
count = 0;
@ -353,7 +351,7 @@ void channel_set_mode(IRC_SERVER_REC *server, const char *channel, const char *m
g_string_append_c(tmode, *curmode);
if (MODE_HAS_ARG(*curmode)) {
if (HAS_MODE_ARG(*curmode)) {
char *arg;
count++;

View file

@ -4,6 +4,9 @@
#include "server.h"
#include "channels.h"
#define HAS_MODE_ARG(c) ((c) == 'b' || (c) == 'e' || (c) == 'I' || \
(c) == 'v' || (c) == 'o' || (c) == 'l' || (c) == 'k')
void modes_init(void);
void modes_deinit(void);

View file

@ -1,6 +1,7 @@
#ifndef __NICKLIST_H
#define __NICKLIST_H
#include "irc-server.h"
#include "channels.h"
typedef struct {

View file

@ -41,7 +41,7 @@ static void get_source_host_ip(void)
/* FIXME: This will block! */
if (!source_host_ok) {
source_host_ok = *settings_get_str("hostname") != '\0' &&
net_gethostname(settings_get_str("hostname"), &ip) == 0;
net_gethostbyname(settings_get_str("hostname"), &ip) == 0;
if (source_host_ok) {
source_host_ip = g_new(IPADDR, 1);
memcpy(source_host_ip, &ip, sizeof(IPADDR));
@ -100,7 +100,7 @@ create_addr_conn(const char *address, int port, const char *password,
/* resolve the IP and use it */
IPADDR ip;
if (net_gethostname(sserver->own_host, &ip) == 0) {
if (net_gethostbyname(sserver->own_host, &ip) == 0) {
if (conn->own_ip == NULL)
conn->own_ip = g_new(IPADDR, 1);
memcpy(conn->own_ip, &ip, sizeof(IPADDR));