mirror of
https://github.com/irssi/irssi.git
synced 2025-01-03 14:56:47 -05:00
updates
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@634 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
af59f54492
commit
3e2f19b030
@ -173,7 +173,7 @@ create_addr_conn(const char *address, int port,
|
||||
g_return_val_if_fail(address != NULL, NULL);
|
||||
|
||||
sserver = server_setup_find(address, port);
|
||||
chatnet = sserver->chatnet == NULL ? NULL :
|
||||
chatnet = sserver == NULL || sserver->chatnet == NULL ? NULL :
|
||||
chatnet_find(sserver->chatnet);
|
||||
conn = NULL;
|
||||
signal_emit("server setup connect", 2, &conn, chatnet);
|
||||
|
@ -206,6 +206,23 @@ int server_start_connect(SERVER_REC *server)
|
||||
MODULE_DATA_INIT(server);
|
||||
server->type = module_get_uniq_id("SERVER", 0);
|
||||
|
||||
server->nick = g_strdup(server->connrec->nick);
|
||||
if (server->connrec->port <= 0) server->connrec->port = 6667;
|
||||
if (server->connrec->username == NULL || *server->connrec->username == '\0') {
|
||||
g_free_not_null(server->connrec->username);
|
||||
|
||||
server->connrec->username = g_get_user_name();
|
||||
if (*server->connrec->username == '\0') server->connrec->username = "-";
|
||||
server->connrec->username = g_strdup(server->connrec->username);
|
||||
}
|
||||
if (server->connrec->realname == NULL || *server->connrec->realname == '\0') {
|
||||
g_free_not_null(server->connrec->realname);
|
||||
|
||||
server->connrec->realname = g_get_real_name();
|
||||
if (*server->connrec->realname == '\0') server->connrec->realname = "-";
|
||||
server->connrec->realname = g_strdup(server->connrec->realname);
|
||||
}
|
||||
|
||||
if (pipe(server->connect_pipe) != 0) {
|
||||
g_warning("server_connect(): pipe() failed.");
|
||||
return FALSE;
|
||||
|
@ -38,7 +38,7 @@ static void print_servers(void)
|
||||
GSList *tmp;
|
||||
|
||||
for (tmp = servers; tmp != NULL; tmp = tmp->next) {
|
||||
IRC_SERVER_REC *rec = tmp->data;
|
||||
SERVER_REC *rec = tmp->data;
|
||||
|
||||
printformat(NULL, NULL, MSGLEVEL_CRAP, IRCTXT_SERVER_LIST,
|
||||
rec->tag, rec->connrec->address, rec->connrec->port,
|
||||
@ -50,7 +50,7 @@ static void print_lookup_servers(void)
|
||||
{
|
||||
GSList *tmp;
|
||||
for (tmp = lookup_servers; tmp != NULL; tmp = tmp->next) {
|
||||
IRC_SERVER_REC *rec = tmp->data;
|
||||
SERVER_REC *rec = tmp->data;
|
||||
|
||||
printformat(NULL, NULL, MSGLEVEL_CRAP, IRCTXT_SERVER_LOOKUP_LIST,
|
||||
rec->tag, rec->connrec->address, rec->connrec->port,
|
||||
|
@ -61,7 +61,7 @@ IRC_CHANNEL_REC *irc_channel_create(IRC_SERVER_REC *server,
|
||||
return rec;
|
||||
}
|
||||
|
||||
void sig_channel_destroyed(IRC_CHANNEL_REC *channel)
|
||||
static void sig_channel_destroyed(IRC_CHANNEL_REC *channel)
|
||||
{
|
||||
if (!IS_IRC_CHANNEL(channel))
|
||||
return;
|
||||
|
@ -37,6 +37,7 @@ IRC_CHANNEL_REC *irc_channel_create(IRC_SERVER_REC *server,
|
||||
IRC_CHANNEL(channel_find(SERVER(server), name))
|
||||
|
||||
/* Join to channels. `data' contains channels and channel keys */
|
||||
void irc_channels_join(IRC_SERVER_REC *server, const char *data, int automatic);
|
||||
void irc_channels_join(IRC_SERVER_REC *server,
|
||||
const char *data, int automatic);
|
||||
|
||||
#endif
|
||||
|
@ -86,10 +86,10 @@ IRC_SERVER_REC *irccmd_options_get_server(const char *cmd,
|
||||
return (IRC_SERVER_REC *) server;
|
||||
}
|
||||
|
||||
static IRC_SERVER_REC *connect_server(const char *data)
|
||||
static SERVER_REC *connect_server(const char *data)
|
||||
{
|
||||
SERVER_CONNECT_REC *conn;
|
||||
IRC_SERVER_REC *server;
|
||||
SERVER_REC *server;
|
||||
GHashTable *optlist;
|
||||
char *addr, *portstr, *password, *nick, *ircnet, *host;
|
||||
void *free_arg;
|
||||
@ -126,7 +126,7 @@ static IRC_SERVER_REC *connect_server(const char *data)
|
||||
memcpy(conn->own_ip, &ip, sizeof(IPADDR));
|
||||
}
|
||||
}
|
||||
server = irc_server_connect(IRC_SERVER_CONNECT(conn));
|
||||
server = server_connect(conn);
|
||||
|
||||
cmd_params_free(free_arg);
|
||||
return server;
|
||||
@ -202,7 +202,7 @@ static void cmd_server(const char *data, IRC_SERVER_REC *server)
|
||||
cmd_disconnect("* Changing server", server);
|
||||
}
|
||||
|
||||
server = connect_server(data);
|
||||
server = IRC_SERVER(connect_server(data));
|
||||
if (*addr == '+' || server == NULL ||
|
||||
(ircnet != NULL && server->connrec->chatnet != NULL &&
|
||||
g_strcasecmp(ircnet, server->connrec->chatnet) != 0)) {
|
||||
|
@ -9,7 +9,7 @@ void irc_nicklist_deinit(void);
|
||||
/* Remove all "extra" characters from `nick'. Like _nick_ -> nick */
|
||||
char *irc_nick_strip(const char *nick);
|
||||
|
||||
/* Check is `msg' is meant for `nick'. */
|
||||
/* Check if `msg' is meant for `nick'. */
|
||||
int irc_nick_match(const char *nick, const char *msg);
|
||||
|
||||
#endif
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
servers-setup.c : irssi
|
||||
irc-servers-setup.c : irssi
|
||||
|
||||
Copyright (C) 1999-2000 Timo Sirainen
|
||||
|
||||
|
@ -113,25 +113,8 @@ IRC_SERVER_REC *irc_server_connect(IRC_SERVER_CONNECT_REC *conn)
|
||||
|
||||
server = g_new0(IRC_SERVER_REC, 1);
|
||||
server->chat_type = module_get_uniq_id("IRC SERVER", 0);
|
||||
|
||||
server->connrec = conn;
|
||||
if (conn->port <= 0) conn->port = 6667;
|
||||
if (conn->username == NULL || *conn->username == '\0') {
|
||||
g_free_not_null(conn->username);
|
||||
|
||||
conn->username = g_get_user_name();
|
||||
if (*conn->username == '\0') conn->username = "-";
|
||||
conn->username = g_strdup(conn->username);
|
||||
}
|
||||
if (conn->realname == NULL || *conn->realname == '\0') {
|
||||
g_free_not_null(conn->realname);
|
||||
|
||||
conn->realname = g_get_real_name();
|
||||
if (*conn->realname == '\0') conn->realname = "-";
|
||||
conn->realname = g_strdup(conn->realname);
|
||||
}
|
||||
|
||||
server->nick = g_strdup(conn->nick);
|
||||
if (server->connrec->port <= 0) server->connrec->port = 6667;
|
||||
|
||||
server->cmd_queue_speed = conn->cmd_queue_speed > 0 ?
|
||||
conn->cmd_queue_speed : settings_get_int("cmd_queue_speed");
|
||||
|
Loading…
Reference in New Issue
Block a user