mirror of
https://github.com/weechat/weechat.git
synced 2026-06-28 22:06:38 +02:00
Added "copy" and "rename" options to /server command
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
WeeChat - Wee Enhanced Environment for Chat
|
||||
===========================================
|
||||
|
||||
ChangeLog - 2007-08-06
|
||||
ChangeLog - 2007-08-08
|
||||
|
||||
|
||||
Version 0.2.6 (under dev!):
|
||||
* added "copy" and "rename" options to /server command
|
||||
* added key for setting unread marker on all buffers (default:
|
||||
ctrl-S + ctrl-U) (task 7180)
|
||||
* fixed nick prefix display on servers that doesn't support all prefixes
|
||||
|
||||
@@ -187,7 +187,7 @@
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>set_unread</literal></entry>
|
||||
<entry>set unread marker for all buffers</entry>
|
||||
<entry>set unread marker on all buffers</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>hotlist_clear</literal></entry>
|
||||
|
||||
@@ -167,7 +167,7 @@ Konfiguration abspeichern
|
||||
Datei: Name der zu speichernden Konfigurationsdatei
|
||||
|
||||
</programlisting>
|
||||
<command>server [list [servername]] | [listfull [servername]] | [servername hostname port [-auto | -noauto] [-ipv6] [-ssl] [-pwd password] [-nicks nick1 nick2 nick3] [-username username] [-realname realname] [-command command] [-autojoin channel[,channel]] ] | [del servername]</command>
|
||||
<command>server [list [servername]] | [listfull [servername]] | [servername hostname port [-auto | -noauto] [-ipv6] [-ssl] [-pwd password] [-nicks nick1 nick2 nick3] [-username username] [-realname realname] [-command command] [-autojoin channel[,channel]] ] | [copy server newservername] [rename servername newservername] [del servername]</command>
|
||||
<programlisting>
|
||||
Auflisten, Hinzufügen oder Entfernen von Servern
|
||||
|
||||
@@ -184,6 +184,8 @@ servername: server name, for internal and display use
|
||||
nick3: second alternate nick for server
|
||||
username: user name
|
||||
realname: real name of user
|
||||
copy: duplicate a server
|
||||
rename: rename a server
|
||||
del: delete a server
|
||||
|
||||
</programlisting>
|
||||
|
||||
@@ -187,7 +187,7 @@
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>set_unread</literal></entry>
|
||||
<entry>set unread marker for all buffers</entry>
|
||||
<entry>set unread marker on all buffers</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>hotlist_clear</literal></entry>
|
||||
|
||||
@@ -166,7 +166,7 @@ save config to disk
|
||||
file: filename for writing config
|
||||
|
||||
</programlisting>
|
||||
<command>server [list [servername]] | [listfull [servername]] | [servername hostname port [-auto | -noauto] [-ipv6] [-ssl] [-pwd password] [-nicks nick1 nick2 nick3] [-username username] [-realname realname] [-command command] [-autojoin channel[,channel]] ] | [del servername]</command>
|
||||
<command>server [list [servername]] | [listfull [servername]] | [servername hostname port [-auto | -noauto] [-ipv6] [-ssl] [-pwd password] [-nicks nick1 nick2 nick3] [-username username] [-realname realname] [-command command] [-autojoin channel[,channel]] ] | [copy server newservername] [rename servername newservername] [del servername]</command>
|
||||
<programlisting>
|
||||
list, add or remove servers
|
||||
|
||||
@@ -183,6 +183,8 @@ servername: server name, for internal and display use
|
||||
nick3: second alternate nick for server
|
||||
username: user name
|
||||
realname: real name of user
|
||||
copy: duplicate a server
|
||||
rename: rename a server
|
||||
del: delete a server
|
||||
|
||||
</programlisting>
|
||||
|
||||
@@ -187,7 +187,7 @@
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>set_unread</literal></entry>
|
||||
<entry>set unread marker for all buffers</entry>
|
||||
<entry>positionner le marqueur de données non lues sur tous les tampons</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>hotlist_clear</literal></entry>
|
||||
|
||||
@@ -166,7 +166,7 @@ sauvegarder la configuration sur disque
|
||||
fichier: fichier pour sauvegarder la configuration
|
||||
|
||||
</programlisting>
|
||||
<command>server [list [nom_serveur]] | [listfull [nom_serveur]] | [nom_serveur] | [nom_serveur nom/IP port [-auto | -noauto] [-ipv6] [-ssl] [-pwd mot_de_passe] [-nicks pseudo1 pseudo2 pseudo3] [-username nom_utilisateur] [-realname nom_réel] [-command commande] [-autojoin canal[,canal]] ] | [del nom_serveur]</command>
|
||||
<command>server [list [nom_serveur]] | [listfull [nom_serveur]] | [nom_serveur] | [nom_serveur nom/IP port [-auto | -noauto] [-ipv6] [-ssl] [-pwd mot_de_passe] [-nicks pseudo1 pseudo2 pseudo3] [-username nom_utilisateur] [-realname nom_réel] [-command commande] [-autojoin canal[,canal]] ] | [copy nom_serveur nouveau_nom_serveur] [rename nom_serveur nouveau_nom_serveur] [del nom_serveur]</command>
|
||||
<programlisting>
|
||||
liste, ajoute ou retire des serveurs
|
||||
|
||||
@@ -183,6 +183,8 @@ liste, ajoute ou retire des serveurs
|
||||
pseudo3: second pseudo alternatif pour le serveur
|
||||
nom_utilisateur: nom d'utilisateur
|
||||
nom_réel: nom réel de l'utilisateur
|
||||
copy: dupliquer un serveur
|
||||
rename: renommer un serveur
|
||||
del: supprimer un serveur
|
||||
|
||||
</programlisting>
|
||||
|
||||
+311
-296
File diff suppressed because it is too large
Load Diff
+107
-14
@@ -177,10 +177,11 @@ t_weechat_command weechat_commands[] =
|
||||
NULL, 0, 1, 0, weechat_cmd_save, NULL },
|
||||
{ "server", N_("list, add or remove servers"),
|
||||
N_("[list [servername]] | [listfull [servername]] | "
|
||||
"[servername hostname port [-auto | -noauto] [-ipv6] [-ssl] [-pwd password] [-nicks nick1 "
|
||||
"nick2 nick3] [-username username] [-realname realname] "
|
||||
"[-command command] [-autojoin channel[,channel]] ] | "
|
||||
"[del servername]"),
|
||||
"[servername hostname port [-auto | -noauto] [-ipv6] [-ssl] "
|
||||
"[-pwd password] [-nicks nick1 nick2 nick3] [-username username] "
|
||||
"[-realname realname] [-command command] [-autojoin channel[,channel]] ] | "
|
||||
"[copy server newservername] [rename servername newservername] [del "
|
||||
"servername]"),
|
||||
N_(" list: list servers (no parameter implies this list)\n"
|
||||
" listfull: list servers with detailed info for each server\n"
|
||||
"servername: server name, for internal and display use\n"
|
||||
@@ -194,8 +195,10 @@ t_weechat_command weechat_commands[] =
|
||||
" nick3: second alternate nick for server\n"
|
||||
" username: user name\n"
|
||||
" realname: real name of user\n"
|
||||
" copy: duplicate a server\n"
|
||||
" rename: rename a server\n"
|
||||
" del: delete a server"),
|
||||
"del|list|listfull", 0, MAX_ARGS, 0, weechat_cmd_server, NULL },
|
||||
"copy|rename|del|list|listfull %S %S", 0, MAX_ARGS, 0, weechat_cmd_server, NULL },
|
||||
{ "set", N_("set config options"),
|
||||
N_("[option [ = value]]"),
|
||||
N_("option: name of an option (if name is full "
|
||||
@@ -3022,23 +3025,113 @@ weechat_cmd_server (t_irc_server *server, t_irc_channel *channel,
|
||||
}
|
||||
else
|
||||
{
|
||||
if (ascii_strcasecmp (argv[0], "del") == 0)
|
||||
if (ascii_strcasecmp (argv[0], "copy") == 0)
|
||||
{
|
||||
if (argc < 3)
|
||||
{
|
||||
irc_display_prefix (NULL, NULL, PREFIX_ERROR);
|
||||
gui_printf (NULL,
|
||||
_("%s missing server name for \"%s\" command\n"),
|
||||
WEECHAT_ERROR, "server copy");
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* look for server by name */
|
||||
server_found = irc_server_search (argv[1]);
|
||||
if (!server_found)
|
||||
{
|
||||
irc_display_prefix (NULL, NULL, PREFIX_ERROR);
|
||||
gui_printf (NULL,
|
||||
_("%s server \"%s\" not found for \"%s\" command\n"),
|
||||
WEECHAT_ERROR, argv[1], "server copy");
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* check if target name already exists */
|
||||
if (irc_server_search (argv[2]))
|
||||
{
|
||||
irc_display_prefix (NULL, NULL, PREFIX_ERROR);
|
||||
gui_printf (NULL,
|
||||
_("%s server \"%s\" already exists for \"%s\" command\n"),
|
||||
WEECHAT_ERROR, argv[2], "server copy");
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* duplicate server */
|
||||
new_server = irc_server_duplicate (server_found, argv[2]);
|
||||
if (new_server)
|
||||
{
|
||||
irc_display_prefix (NULL, NULL, PREFIX_INFO);
|
||||
gui_printf (NULL, _("Server %s%s%s has been copied to %s%s\n"),
|
||||
GUI_COLOR(COLOR_WIN_CHAT_SERVER),
|
||||
argv[1],
|
||||
GUI_COLOR(COLOR_WIN_CHAT),
|
||||
GUI_COLOR(COLOR_WIN_CHAT_SERVER),
|
||||
argv[2]);
|
||||
gui_window_redraw_all_buffers ();
|
||||
return 0;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
if (ascii_strcasecmp (argv[0], "rename") == 0)
|
||||
{
|
||||
if (argc < 3)
|
||||
{
|
||||
irc_display_prefix (NULL, NULL, PREFIX_ERROR);
|
||||
gui_printf (NULL,
|
||||
_("%s missing server name for \"%s\" command\n"),
|
||||
WEECHAT_ERROR, "server rename");
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* look for server by name */
|
||||
server_found = irc_server_search (argv[1]);
|
||||
if (!server_found)
|
||||
{
|
||||
irc_display_prefix (NULL, NULL, PREFIX_ERROR);
|
||||
gui_printf (NULL,
|
||||
_("%s server \"%s\" not found for \"%s\" command\n"),
|
||||
WEECHAT_ERROR, argv[1], "server rename");
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* check if target name already exists */
|
||||
if (irc_server_search (argv[2]))
|
||||
{
|
||||
irc_display_prefix (NULL, NULL, PREFIX_ERROR);
|
||||
gui_printf (NULL,
|
||||
_("%s server \"%s\" already exists for \"%s\" command\n"),
|
||||
WEECHAT_ERROR, argv[2], "server rename");
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* rename server */
|
||||
if (irc_server_rename (server_found, argv[2]))
|
||||
{
|
||||
irc_display_prefix (NULL, NULL, PREFIX_INFO);
|
||||
gui_printf (NULL, _("Server %s%s%s has been renamed to %s%s\n"),
|
||||
GUI_COLOR(COLOR_WIN_CHAT_SERVER),
|
||||
argv[1],
|
||||
GUI_COLOR(COLOR_WIN_CHAT),
|
||||
GUI_COLOR(COLOR_WIN_CHAT_SERVER),
|
||||
argv[2]);
|
||||
gui_window_redraw_all_buffers ();
|
||||
return 0;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
else if (ascii_strcasecmp (argv[0], "del") == 0)
|
||||
{
|
||||
if (argc < 2)
|
||||
{
|
||||
irc_display_prefix (NULL, NULL, PREFIX_ERROR);
|
||||
gui_printf (NULL,
|
||||
_("%s missing servername for \"%s\" command\n"),
|
||||
_("%s missing server name for \"%s\" command\n"),
|
||||
WEECHAT_ERROR, "server del");
|
||||
return -1;
|
||||
}
|
||||
if (argc > 2)
|
||||
{
|
||||
irc_display_prefix (NULL, NULL, PREFIX_ERROR);
|
||||
gui_printf (NULL,
|
||||
_("%s too much arguments for \"%s\" command, ignoring arguments\n"),
|
||||
WEECHAT_WARNING, "server del");
|
||||
}
|
||||
|
||||
/* look for server by name */
|
||||
server_found = irc_server_search (argv[1]);
|
||||
|
||||
@@ -219,7 +219,7 @@ session_save_servers (FILE *file)
|
||||
rc = rc && (session_write_int (file, SESSION_SERV_AUTOCONNECT, ptr_server->autoconnect));
|
||||
rc = rc && (session_write_int (file, SESSION_SERV_AUTORECONNECT, ptr_server->autoreconnect));
|
||||
rc = rc && (session_write_int (file, SESSION_SERV_AUTORECONNECT_DELAY, ptr_server->autoreconnect_delay));
|
||||
rc = rc && (session_write_int (file, SESSION_SERV_COMMAND_LINE, ptr_server->command_line));
|
||||
rc = rc && (session_write_int (file, SESSION_SERV_TEMP_SERVER, ptr_server->temp_server));
|
||||
rc = rc && (session_write_str (file, SESSION_SERV_ADDRESS, ptr_server->address));
|
||||
rc = rc && (session_write_int (file, SESSION_SERV_PORT, ptr_server->port));
|
||||
rc = rc && (session_write_int (file, SESSION_SERV_IPV6, ptr_server->ipv6));
|
||||
@@ -881,8 +881,8 @@ session_load_server (FILE *file)
|
||||
case SESSION_SERV_AUTORECONNECT_DELAY:
|
||||
rc = rc && (session_read_int (file, &(session_current_server->autoreconnect_delay)));
|
||||
break;
|
||||
case SESSION_SERV_COMMAND_LINE:
|
||||
rc = rc && (session_read_int (file, &(session_current_server->command_line)));
|
||||
case SESSION_SERV_TEMP_SERVER:
|
||||
rc = rc && (session_read_int (file, &(session_current_server->temp_server)));
|
||||
break;
|
||||
case SESSION_SERV_ADDRESS:
|
||||
rc = rc && (session_read_str (file, &(session_current_server->address)));
|
||||
|
||||
@@ -54,7 +54,7 @@ enum t_session_server
|
||||
SESSION_SERV_AUTOCONNECT,
|
||||
SESSION_SERV_AUTORECONNECT,
|
||||
SESSION_SERV_AUTORECONNECT_DELAY,
|
||||
SESSION_SERV_COMMAND_LINE,
|
||||
SESSION_SERV_TEMP_SERVER,
|
||||
SESSION_SERV_ADDRESS,
|
||||
SESSION_SERV_PORT,
|
||||
SESSION_SERV_IPV6,
|
||||
|
||||
@@ -1188,10 +1188,7 @@ config_change_hotlist ()
|
||||
void
|
||||
config_change_read_marker ()
|
||||
{
|
||||
t_gui_window *ptr_win;
|
||||
|
||||
for (ptr_win = gui_windows; ptr_win; ptr_win = ptr_win->next_window)
|
||||
gui_window_redraw_buffer (ptr_win->buffer);
|
||||
gui_window_redraw_all_buffers ();
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -2526,7 +2523,7 @@ config_write (char *config_name)
|
||||
for (ptr_server = irc_servers; ptr_server;
|
||||
ptr_server = ptr_server->next_server)
|
||||
{
|
||||
if (!ptr_server->command_line)
|
||||
if (!ptr_server->temp_server)
|
||||
{
|
||||
weechat_iconv_fprintf (file, "\n[server]\n");
|
||||
weechat_iconv_fprintf (file, "server_name = \"%s\"\n", ptr_server->name);
|
||||
|
||||
@@ -430,6 +430,21 @@ gui_window_redraw_buffer (t_gui_buffer *buffer)
|
||||
gui_panel_redraw_buffer (buffer);
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_window_redraw_all_buffers: redraw all buffers
|
||||
*/
|
||||
|
||||
void
|
||||
gui_window_redraw_all_buffers ()
|
||||
{
|
||||
t_gui_window *ptr_win;
|
||||
|
||||
for (ptr_win = gui_windows; ptr_win; ptr_win = ptr_win->next_window)
|
||||
{
|
||||
gui_window_redraw_buffer (ptr_win->buffer);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_window_switch_to_buffer: switch to another buffer
|
||||
*/
|
||||
|
||||
@@ -156,6 +156,16 @@ gui_window_redraw_buffer (t_gui_buffer *buffer)
|
||||
(void) buffer;
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_window_redraw_all_buffers: redraw all buffers
|
||||
*/
|
||||
|
||||
void
|
||||
gui_window_redraw_all_buffers ()
|
||||
{
|
||||
/* TODO: write this function for Gtk */
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_window_switch_to_buffer: switch to another buffer
|
||||
*/
|
||||
|
||||
@@ -1405,7 +1405,6 @@ gui_action_scroll_unread (t_gui_window *window, char *args)
|
||||
void
|
||||
gui_action_set_unread (t_gui_window *window, char *args)
|
||||
{
|
||||
t_gui_window *ptr_win;
|
||||
t_gui_buffer *ptr_buffer;
|
||||
|
||||
/* make C compiler happy */
|
||||
@@ -1421,10 +1420,7 @@ gui_action_set_unread (t_gui_window *window, char *args)
|
||||
}
|
||||
|
||||
/* refresh all windows */
|
||||
for (ptr_win = gui_windows; ptr_win; ptr_win = ptr_win->next_window)
|
||||
{
|
||||
gui_window_redraw_buffer (ptr_win->buffer);
|
||||
}
|
||||
gui_window_redraw_all_buffers ();
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -250,6 +250,7 @@ extern int gui_window_objects_init (t_gui_window *);
|
||||
extern void gui_window_objects_free (t_gui_window *, int);
|
||||
extern int gui_window_calculate_pos_size (t_gui_window *, int);
|
||||
extern void gui_window_redraw_buffer (t_gui_buffer *);
|
||||
extern void gui_window_redraw_all_buffers ();
|
||||
extern void gui_window_switch_to_buffer (t_gui_window *, t_gui_buffer *);
|
||||
extern void gui_window_page_up (t_gui_window *);
|
||||
extern void gui_window_page_down (t_gui_window *);
|
||||
|
||||
@@ -396,7 +396,7 @@ irc_display_server (t_irc_server *server, int with_detail)
|
||||
|
||||
gui_printf (NULL, " server_autoconnect . . . . : %s%s\n",
|
||||
(server->autoconnect) ? _("on") : _("off"),
|
||||
(server->command_line) ?
|
||||
(server->temp_server) ?
|
||||
_(" (temporary server, will not be saved)") : "");
|
||||
gui_printf (NULL, " server_autoreconnect . . . : %s\n",
|
||||
(server->autoreconnect) ? _("on") : _("off"));
|
||||
@@ -478,6 +478,6 @@ irc_display_server (t_irc_server *server, int with_detail)
|
||||
gui_printf (NULL, "%s]%s%s\n",
|
||||
GUI_COLOR(COLOR_WIN_CHAT_DARK),
|
||||
GUI_COLOR(COLOR_WIN_CHAT),
|
||||
(server->command_line) ? _(" (temporary)") : "");
|
||||
(server->temp_server) ? _(" (temporary)") : "");
|
||||
}
|
||||
}
|
||||
|
||||
+11
-13
@@ -2742,7 +2742,7 @@ irc_recv_cmd_303 (t_irc_server *server, char *host, char *nick, char *arguments)
|
||||
int
|
||||
irc_recv_cmd_305 (t_irc_server *server, char *host, char *nick, char *arguments)
|
||||
{
|
||||
t_gui_window *ptr_window;
|
||||
t_gui_window *ptr_win;
|
||||
|
||||
/* make C compiler happy */
|
||||
(void) host;
|
||||
@@ -2763,11 +2763,10 @@ irc_recv_cmd_305 (t_irc_server *server, char *host, char *nick, char *arguments)
|
||||
}
|
||||
server->is_away = 0;
|
||||
server->away_time = 0;
|
||||
for (ptr_window = gui_windows; ptr_window;
|
||||
ptr_window = ptr_window->next_window)
|
||||
for (ptr_win = gui_windows; ptr_win; ptr_win = ptr_win->next_window)
|
||||
{
|
||||
if (SERVER(ptr_window->buffer) == server)
|
||||
gui_status_draw (ptr_window->buffer, 1);
|
||||
if (SERVER(ptr_win->buffer) == server)
|
||||
gui_status_draw (ptr_win->buffer, 1);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -2779,7 +2778,7 @@ irc_recv_cmd_305 (t_irc_server *server, char *host, char *nick, char *arguments)
|
||||
int
|
||||
irc_recv_cmd_306 (t_irc_server *server, char *host, char *nick, char *arguments)
|
||||
{
|
||||
t_gui_window *ptr_window;
|
||||
t_gui_window *ptr_win;
|
||||
|
||||
/* make C compiler happy */
|
||||
(void) host;
|
||||
@@ -2800,14 +2799,13 @@ irc_recv_cmd_306 (t_irc_server *server, char *host, char *nick, char *arguments)
|
||||
}
|
||||
server->is_away = 1;
|
||||
server->away_time = time (NULL);
|
||||
for (ptr_window = gui_windows; ptr_window;
|
||||
ptr_window = ptr_window->next_window)
|
||||
for (ptr_win = gui_windows; ptr_win; ptr_win = ptr_win->next_window)
|
||||
{
|
||||
if (SERVER(ptr_window->buffer) == server)
|
||||
gui_status_draw (ptr_window->buffer, 1);
|
||||
if (SERVER(ptr_window->buffer) == server)
|
||||
ptr_window->buffer->last_read_line =
|
||||
ptr_window->buffer->last_line;
|
||||
if (SERVER(ptr_win->buffer) == server)
|
||||
gui_status_draw (ptr_win->buffer, 1);
|
||||
if (SERVER(ptr_win->buffer) == server)
|
||||
ptr_win->buffer->last_read_line =
|
||||
ptr_win->buffer->last_line;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
+74
-7
@@ -85,7 +85,7 @@ irc_server_init (t_irc_server *server)
|
||||
server->autoconnect = 0;
|
||||
server->autoreconnect = 1;
|
||||
server->autoreconnect_delay = 30;
|
||||
server->command_line = 0;
|
||||
server->temp_server = 0;
|
||||
server->address = NULL;
|
||||
server->port = -1;
|
||||
server->ipv6 = 0;
|
||||
@@ -466,7 +466,7 @@ irc_server_free_all ()
|
||||
|
||||
t_irc_server *
|
||||
irc_server_new (char *name, int autoconnect, int autoreconnect,
|
||||
int autoreconnect_delay, int command_line, char *address,
|
||||
int autoreconnect_delay, int temp_server, char *address,
|
||||
int port, int ipv6, int ssl, char *password,
|
||||
char *nick1, char *nick2, char *nick3, char *username,
|
||||
char *realname, char *hostname, char *command, int command_delay,
|
||||
@@ -496,7 +496,7 @@ irc_server_new (char *name, int autoconnect, int autoreconnect,
|
||||
new_server->autoconnect = autoconnect;
|
||||
new_server->autoreconnect = autoreconnect;
|
||||
new_server->autoreconnect_delay = autoreconnect_delay;
|
||||
new_server->command_line = command_line;
|
||||
new_server->temp_server = temp_server;
|
||||
new_server->address = strdup (address);
|
||||
new_server->port = port;
|
||||
new_server->ipv6 = ipv6;
|
||||
@@ -525,8 +525,75 @@ irc_server_new (char *name, int autoconnect, int autoreconnect,
|
||||
return new_server;
|
||||
}
|
||||
|
||||
/*
|
||||
* irc_server_duplicate: duplicate a server
|
||||
* return: pointer to new server, NULL if error
|
||||
*/
|
||||
|
||||
t_irc_server *
|
||||
irc_server_duplicate (t_irc_server *server, char *new_name)
|
||||
{
|
||||
t_irc_server *new_server;
|
||||
|
||||
/* check if another server exists with this name */
|
||||
if (irc_server_search (new_name))
|
||||
return 0;
|
||||
|
||||
/* duplicate server */
|
||||
new_server = irc_server_new (new_name,
|
||||
server->autoconnect,
|
||||
server->autoreconnect,
|
||||
server->autoreconnect_delay,
|
||||
server->temp_server,
|
||||
server->address,
|
||||
server->port,
|
||||
server->ipv6,
|
||||
server->ssl,
|
||||
server->password,
|
||||
server->nick1,
|
||||
server->nick2,
|
||||
server->nick3,
|
||||
server->username,
|
||||
server->realname,
|
||||
server->hostname,
|
||||
server->command,
|
||||
server->command_delay,
|
||||
server->autojoin,
|
||||
server->autorejoin,
|
||||
server->notify_levels);
|
||||
|
||||
return new_server;
|
||||
}
|
||||
|
||||
/*
|
||||
* irc_server_rename: rename server (internal name)
|
||||
* return: 1 if ok, 0 if error
|
||||
*/
|
||||
|
||||
int
|
||||
irc_server_rename (t_irc_server *server, char *new_name)
|
||||
{
|
||||
char *str;
|
||||
|
||||
/* check if another server exists with this name */
|
||||
if (irc_server_search (new_name))
|
||||
return 0;
|
||||
|
||||
/* rename server */
|
||||
str = strdup (new_name);
|
||||
if (str)
|
||||
{
|
||||
if (server->name)
|
||||
free (server->name);
|
||||
server->name = str;
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* irc_server_send: send data to IRC server
|
||||
* return number of bytes sent, -1 if error
|
||||
*/
|
||||
|
||||
int
|
||||
@@ -1911,15 +1978,15 @@ irc_server_reconnect (t_irc_server *server)
|
||||
*/
|
||||
|
||||
void
|
||||
irc_server_auto_connect (int auto_connect, int command_line)
|
||||
irc_server_auto_connect (int auto_connect, int temp_server)
|
||||
{
|
||||
t_irc_server *ptr_server;
|
||||
|
||||
for (ptr_server = irc_servers; ptr_server;
|
||||
ptr_server = ptr_server->next_server)
|
||||
{
|
||||
if ( ((command_line) && (ptr_server->command_line))
|
||||
|| ((!command_line) && (auto_connect) && (ptr_server->autoconnect)) )
|
||||
if ( ((temp_server) && (ptr_server->temp_server))
|
||||
|| ((!temp_server) && (auto_connect) && (ptr_server->autoconnect)) )
|
||||
{
|
||||
(void) gui_buffer_new (gui_current_window, ptr_server, NULL,
|
||||
BUFFER_TYPE_STANDARD, 1);
|
||||
@@ -2255,7 +2322,7 @@ irc_server_print_log (t_irc_server *server)
|
||||
weechat_log_printf (" autoconnect . . . . : %d\n", server->autoconnect);
|
||||
weechat_log_printf (" autoreconnect . . . : %d\n", server->autoreconnect);
|
||||
weechat_log_printf (" autoreconnect_delay : %d\n", server->autoreconnect_delay);
|
||||
weechat_log_printf (" command_line. . . . : %d\n", server->command_line);
|
||||
weechat_log_printf (" temp_server . . . . : %d\n", server->temp_server);
|
||||
weechat_log_printf (" address . . . . . . : '%s'\n", server->address);
|
||||
weechat_log_printf (" port. . . . . . . . : %d\n", server->port);
|
||||
weechat_log_printf (" ipv6. . . . . . . . : %d\n", server->ipv6);
|
||||
|
||||
+4
-5
@@ -146,11 +146,11 @@ typedef struct t_irc_server t_irc_server;
|
||||
struct t_irc_server
|
||||
{
|
||||
/* user choices */
|
||||
char *name; /* name of server (only for display) */
|
||||
char *name; /* internal name of server */
|
||||
int autoconnect; /* = 1 if auto connect at startup */
|
||||
int autoreconnect; /* = 1 if auto reco when disconnected */
|
||||
int autoreconnect_delay; /* delay before trying again reconnect */
|
||||
int command_line; /* server was given on command line */
|
||||
int temp_server; /* server is temporary (will not be saved)*/
|
||||
char *address; /* address of server (IP or name) */
|
||||
int port; /* port for server (6667 by default) */
|
||||
int ipv6; /* use IPv6 protocol */
|
||||
@@ -373,9 +373,8 @@ extern void irc_server_free_all ();
|
||||
extern t_irc_server *irc_server_new (char *, int, int, int, int, char *, int, int, int,
|
||||
char *, char *, char *, char *, char *, char *,
|
||||
char *, char *, int, char *, int, char *);
|
||||
extern char *irc_server_get_charset_decode_iso (t_irc_server *);
|
||||
extern char *irc_server_get_charset_decode_utf (t_irc_server *);
|
||||
extern char *irc_server_get_charset_encode (t_irc_server *);
|
||||
extern t_irc_server *irc_server_duplicate (t_irc_server *, char *);
|
||||
extern int irc_server_rename (t_irc_server *, char *);
|
||||
extern int irc_server_send (t_irc_server *, char *, int);
|
||||
extern void irc_server_outqueue_send (t_irc_server *);
|
||||
extern void irc_server_sendf (t_irc_server *, char *, ...);
|
||||
|
||||
@@ -916,7 +916,7 @@ weechat_plugin_get_server_info (t_weechat_plugin *plugin)
|
||||
new_server_info->autoconnect = ptr_server->autoconnect;
|
||||
new_server_info->autoreconnect = ptr_server->autoreconnect;
|
||||
new_server_info->autoreconnect_delay = ptr_server->autoreconnect_delay;
|
||||
new_server_info->command_line = ptr_server->command_line;
|
||||
new_server_info->temp_server = ptr_server->temp_server;
|
||||
new_server_info->address = (ptr_server->address) ? strdup (ptr_server->address) : strdup ("");
|
||||
new_server_info->port = ptr_server->port;
|
||||
new_server_info->ipv6 = ptr_server->ipv6;
|
||||
@@ -1246,7 +1246,7 @@ t_plugin_window_info *
|
||||
weechat_plugin_get_window_info (t_weechat_plugin *plugin)
|
||||
{
|
||||
t_plugin_window_info *window_info, *last_window_info, *new_window_info;
|
||||
t_gui_window *ptr_window;
|
||||
t_gui_window *ptr_win;
|
||||
|
||||
if (!plugin)
|
||||
return NULL;
|
||||
@@ -1255,18 +1255,18 @@ weechat_plugin_get_window_info (t_weechat_plugin *plugin)
|
||||
{
|
||||
window_info = NULL;
|
||||
last_window_info = NULL;
|
||||
for (ptr_window = gui_windows; ptr_window; ptr_window = ptr_window->next_window)
|
||||
for (ptr_win = gui_windows; ptr_win; ptr_win = ptr_win->next_window)
|
||||
{
|
||||
new_window_info = (t_plugin_window_info *) malloc (sizeof (t_plugin_window_info));
|
||||
if (new_window_info)
|
||||
{
|
||||
new_window_info->win_x = ptr_window->win_x;
|
||||
new_window_info->win_y = ptr_window->win_y;
|
||||
new_window_info->win_width = ptr_window->win_width;
|
||||
new_window_info->win_height = ptr_window->win_height;
|
||||
new_window_info->win_width_pct = ptr_window->win_width_pct;
|
||||
new_window_info->win_height_pct = ptr_window->win_height_pct;
|
||||
new_window_info->num_buffer = (ptr_window->buffer) ? ptr_window->buffer->number : 0;
|
||||
new_window_info->win_x = ptr_win->win_x;
|
||||
new_window_info->win_y = ptr_win->win_y;
|
||||
new_window_info->win_width = ptr_win->win_width;
|
||||
new_window_info->win_height = ptr_win->win_height;
|
||||
new_window_info->win_width_pct = ptr_win->win_width_pct;
|
||||
new_window_info->win_height_pct = ptr_win->win_height_pct;
|
||||
new_window_info->num_buffer = (ptr_win->buffer) ? ptr_win->buffer->number : 0;
|
||||
|
||||
new_window_info->prev_window = last_window_info;
|
||||
new_window_info->next_window = NULL;
|
||||
|
||||
@@ -1672,8 +1672,8 @@ weechat_lua_get_server_info (lua_State *L)
|
||||
lua_pushnumber (lua_current_interpreter, ptr_server->autoreconnect_delay);
|
||||
lua_rawset (lua_current_interpreter, -3);
|
||||
|
||||
lua_pushstring (lua_current_interpreter, "command_line");
|
||||
lua_pushnumber (lua_current_interpreter, ptr_server->command_line);
|
||||
lua_pushstring (lua_current_interpreter, "temp_server");
|
||||
lua_pushnumber (lua_current_interpreter, ptr_server->temp_server);
|
||||
lua_rawset (lua_current_interpreter, -3);
|
||||
|
||||
lua_pushstring (lua_current_interpreter, "address");
|
||||
@@ -1973,7 +1973,7 @@ weechat_lua_get_irc_color (lua_State *L)
|
||||
static int
|
||||
weechat_lua_get_window_info (lua_State *L)
|
||||
{
|
||||
t_plugin_window_info *window_info, *ptr_window;
|
||||
t_plugin_window_info *window_info, *ptr_win;
|
||||
int i;
|
||||
|
||||
/* make C compiler happy */
|
||||
@@ -1997,40 +1997,43 @@ weechat_lua_get_window_info (lua_State *L)
|
||||
|
||||
lua_newtable (lua_current_interpreter);
|
||||
|
||||
for (i = 0, ptr_window = window_info; ptr_window; ptr_window = ptr_window->next_window, i++)
|
||||
i = 0;
|
||||
for (ptr_win = window_info; ptr_win; ptr_win = ptr_win->next_window)
|
||||
{
|
||||
lua_pushnumber (lua_current_interpreter, i);
|
||||
lua_newtable (lua_current_interpreter);
|
||||
|
||||
lua_pushstring (lua_current_interpreter, "num_buffer");
|
||||
lua_pushnumber (lua_current_interpreter, ptr_window->num_buffer);
|
||||
lua_pushnumber (lua_current_interpreter, ptr_win->num_buffer);
|
||||
lua_rawset (lua_current_interpreter, -3);
|
||||
|
||||
lua_pushstring (lua_current_interpreter, "win_x");
|
||||
lua_pushnumber (lua_current_interpreter, ptr_window->win_x);
|
||||
lua_pushnumber (lua_current_interpreter, ptr_win->win_x);
|
||||
lua_rawset (lua_current_interpreter, -3);
|
||||
|
||||
lua_pushstring (lua_current_interpreter, "win_y");
|
||||
lua_pushnumber (lua_current_interpreter, ptr_window->win_y);
|
||||
lua_pushnumber (lua_current_interpreter, ptr_win->win_y);
|
||||
lua_rawset (lua_current_interpreter, -3);
|
||||
|
||||
lua_pushstring (lua_current_interpreter, "win_width");
|
||||
lua_pushnumber (lua_current_interpreter, ptr_window->win_width);
|
||||
lua_pushnumber (lua_current_interpreter, ptr_win->win_width);
|
||||
lua_rawset (lua_current_interpreter, -3);
|
||||
|
||||
lua_pushstring (lua_current_interpreter, "win_height");
|
||||
lua_pushnumber (lua_current_interpreter, ptr_window->win_height);
|
||||
lua_pushnumber (lua_current_interpreter, ptr_win->win_height);
|
||||
lua_rawset (lua_current_interpreter, -3);
|
||||
|
||||
lua_pushstring (lua_current_interpreter, "win_width_pct");
|
||||
lua_pushnumber (lua_current_interpreter, ptr_window->win_width_pct);
|
||||
lua_pushnumber (lua_current_interpreter, ptr_win->win_width_pct);
|
||||
lua_rawset (lua_current_interpreter, -3);
|
||||
|
||||
lua_pushstring (lua_current_interpreter, "win_height_pct");
|
||||
lua_pushnumber (lua_current_interpreter, ptr_window->win_height_pct);
|
||||
lua_pushnumber (lua_current_interpreter, ptr_win->win_height_pct);
|
||||
lua_rawset (lua_current_interpreter, -3);
|
||||
|
||||
lua_rawset (lua_current_interpreter, -3);
|
||||
|
||||
i++;
|
||||
}
|
||||
|
||||
lua_plugin->free_window_info (lua_plugin, window_info);
|
||||
|
||||
@@ -1465,7 +1465,7 @@ static XS (XS_weechat_get_server_info)
|
||||
hv_store (server_hash_member, "autoconnect", 11, newSViv (ptr_server->autoconnect), 0);
|
||||
hv_store (server_hash_member, "autoreconnect", 13, newSViv (ptr_server->autoreconnect), 0);
|
||||
hv_store (server_hash_member, "autoreconnect_delay", 19, newSViv (ptr_server->autoreconnect_delay), 0);
|
||||
hv_store (server_hash_member, "command_line", 12, newSViv (ptr_server->command_line), 0);
|
||||
hv_store (server_hash_member, "temp_server", 11, newSViv (ptr_server->temp_server), 0);
|
||||
hv_store (server_hash_member, "address", 7, newSVpv (ptr_server->address, 0), 0);
|
||||
hv_store (server_hash_member, "port", 4, newSViv (ptr_server->port), 0);
|
||||
hv_store (server_hash_member, "ipv6", 4, newSViv (ptr_server->ipv6), 0);
|
||||
@@ -1717,7 +1717,7 @@ static XS (XS_weechat_get_irc_color)
|
||||
|
||||
static XS (XS_weechat_get_window_info)
|
||||
{
|
||||
t_plugin_window_info *window_info, *ptr_window;
|
||||
t_plugin_window_info *window_info, *ptr_win;
|
||||
int count;
|
||||
HV *window_hash_member;
|
||||
dXSARGS;
|
||||
@@ -1739,17 +1739,17 @@ static XS (XS_weechat_get_window_info)
|
||||
if (!window_info)
|
||||
XSRETURN_EMPTY;
|
||||
|
||||
for (ptr_window = window_info; ptr_window; ptr_window = ptr_window->next_window)
|
||||
for (ptr_win = window_info; ptr_win; ptr_win = ptr_win->next_window)
|
||||
{
|
||||
window_hash_member = (HV *) sv_2mortal((SV *) newHV());
|
||||
|
||||
hv_store (window_hash_member, "num_buffer", 10, newSViv (ptr_window->num_buffer), 0);
|
||||
hv_store (window_hash_member, "win_x", 5, newSViv (ptr_window->win_x), 0);
|
||||
hv_store (window_hash_member, "win_y", 5, newSViv (ptr_window->win_y), 0);
|
||||
hv_store (window_hash_member, "win_width", 9, newSViv (ptr_window->win_width), 0);
|
||||
hv_store (window_hash_member, "win_height", 10, newSViv (ptr_window->win_height), 0);
|
||||
hv_store (window_hash_member, "win_width_pct", 13, newSViv (ptr_window->win_width_pct), 0);
|
||||
hv_store (window_hash_member, "win_height_pct", 14, newSViv (ptr_window->win_height_pct), 0);
|
||||
hv_store (window_hash_member, "num_buffer", 10, newSViv (ptr_win->num_buffer), 0);
|
||||
hv_store (window_hash_member, "win_x", 5, newSViv (ptr_win->win_x), 0);
|
||||
hv_store (window_hash_member, "win_y", 5, newSViv (ptr_win->win_y), 0);
|
||||
hv_store (window_hash_member, "win_width", 9, newSViv (ptr_win->win_width), 0);
|
||||
hv_store (window_hash_member, "win_height", 10, newSViv (ptr_win->win_height), 0);
|
||||
hv_store (window_hash_member, "win_width_pct", 13, newSViv (ptr_win->win_width_pct), 0);
|
||||
hv_store (window_hash_member, "win_height_pct", 14, newSViv (ptr_win->win_height_pct), 0);
|
||||
|
||||
XPUSHs(newRV_inc((SV *) window_hash_member));
|
||||
count++;
|
||||
|
||||
@@ -1495,8 +1495,8 @@ weechat_python_get_server_info (PyObject *self, PyObject *args)
|
||||
Py_DECREF (key);
|
||||
Py_DECREF (value);
|
||||
|
||||
key = Py_BuildValue("s", "command_line");
|
||||
value = Py_BuildValue("i", ptr_server->command_line);
|
||||
key = Py_BuildValue("s", "temp_server");
|
||||
value = Py_BuildValue("i", ptr_server->temp_server);
|
||||
PyDict_SetItem(server_hash_member, key, value);
|
||||
Py_DECREF (key);
|
||||
Py_DECREF (value);
|
||||
@@ -1856,7 +1856,7 @@ weechat_python_get_irc_color (PyObject *self, PyObject *args)
|
||||
static PyObject *
|
||||
weechat_python_get_window_info (PyObject *self, PyObject *args)
|
||||
{
|
||||
t_plugin_window_info *window_info, *ptr_window;
|
||||
t_plugin_window_info *window_info, *ptr_win;
|
||||
PyObject *window_list, *window_list_member, *key, *value;
|
||||
|
||||
/* make C compiler happy */
|
||||
@@ -1879,53 +1879,53 @@ weechat_python_get_window_info (PyObject *self, PyObject *args)
|
||||
}
|
||||
|
||||
window_info = python_plugin->get_window_info (python_plugin);
|
||||
if (!window_info)
|
||||
if (!window_info)
|
||||
return window_list;
|
||||
|
||||
for(ptr_window = window_info; ptr_window; ptr_window = ptr_window->next_window)
|
||||
for (ptr_win = window_info; ptr_win; ptr_win = ptr_win->next_window)
|
||||
{
|
||||
window_list_member = PyDict_New();
|
||||
|
||||
if (window_list_member)
|
||||
{
|
||||
key = Py_BuildValue("s", "num_buffer");
|
||||
value = Py_BuildValue("i", ptr_window->num_buffer);
|
||||
value = Py_BuildValue("i", ptr_win->num_buffer);
|
||||
PyDict_SetItem(window_list_member, key, value);
|
||||
Py_DECREF (key);
|
||||
Py_DECREF (value);
|
||||
|
||||
key = Py_BuildValue("s", "win_x");
|
||||
value = Py_BuildValue("i", ptr_window->win_x);
|
||||
value = Py_BuildValue("i", ptr_win->win_x);
|
||||
PyDict_SetItem(window_list_member, key, value);
|
||||
Py_DECREF (key);
|
||||
Py_DECREF (value);
|
||||
|
||||
key = Py_BuildValue("s", "win_y");
|
||||
value = Py_BuildValue("i", ptr_window->win_y);
|
||||
value = Py_BuildValue("i", ptr_win->win_y);
|
||||
PyDict_SetItem(window_list_member, key, value);
|
||||
Py_DECREF (key);
|
||||
Py_DECREF (value);
|
||||
|
||||
key = Py_BuildValue("s", "win_width");
|
||||
value = Py_BuildValue("i", ptr_window->win_width);
|
||||
value = Py_BuildValue("i", ptr_win->win_width);
|
||||
PyDict_SetItem(window_list_member, key, value);
|
||||
Py_DECREF (key);
|
||||
Py_DECREF (value);
|
||||
|
||||
key = Py_BuildValue("s", "win_height");
|
||||
value = Py_BuildValue("i", ptr_window->win_height);
|
||||
value = Py_BuildValue("i", ptr_win->win_height);
|
||||
PyDict_SetItem(window_list_member, key, value);
|
||||
Py_DECREF (key);
|
||||
Py_DECREF (value);
|
||||
|
||||
key = Py_BuildValue("s", "win_width_pct");
|
||||
value = Py_BuildValue("i", ptr_window->win_width_pct);
|
||||
value = Py_BuildValue("i", ptr_win->win_width_pct);
|
||||
PyDict_SetItem(window_list_member, key, value);
|
||||
Py_DECREF (key);
|
||||
Py_DECREF (value);
|
||||
|
||||
key = Py_BuildValue("s", "win_height_pct");
|
||||
value = Py_BuildValue("i", ptr_window->win_height_pct);
|
||||
value = Py_BuildValue("i", ptr_win->win_height_pct);
|
||||
PyDict_SetItem(window_list_member, key, value);
|
||||
Py_DECREF (key);
|
||||
Py_DECREF (value);
|
||||
|
||||
@@ -1669,8 +1669,8 @@ weechat_ruby_get_server_info (VALUE class)
|
||||
INT2FIX(ptr_server->autoreconnect));
|
||||
rb_hash_aset (server_hash_member, rb_str_new2("autoreconnect_delay"),
|
||||
INT2FIX(ptr_server->autoreconnect_delay));
|
||||
rb_hash_aset (server_hash_member, rb_str_new2("command_line"),
|
||||
INT2FIX(ptr_server->command_line));
|
||||
rb_hash_aset (server_hash_member, rb_str_new2("temp_server"),
|
||||
INT2FIX(ptr_server->temp_server));
|
||||
rb_hash_aset (server_hash_member, rb_str_new2("address"),
|
||||
rb_str_new2(ptr_server->address));
|
||||
rb_hash_aset (server_hash_member, rb_str_new2("port"),
|
||||
@@ -1910,7 +1910,7 @@ weechat_ruby_get_irc_color (VALUE class, VALUE color)
|
||||
static VALUE
|
||||
weechat_ruby_get_window_info (VALUE class)
|
||||
{
|
||||
t_plugin_window_info *window_info, *ptr_window;
|
||||
t_plugin_window_info *window_info, *ptr_win;
|
||||
VALUE window_list, window_list_member;
|
||||
|
||||
/* make C compiler happy */
|
||||
@@ -1933,26 +1933,26 @@ weechat_ruby_get_window_info (VALUE class)
|
||||
if (!window_info)
|
||||
return window_list;
|
||||
|
||||
for(ptr_window = window_info; ptr_window; ptr_window = ptr_window->next_window)
|
||||
for (ptr_win = window_info; ptr_win; ptr_win = ptr_win->next_window)
|
||||
{
|
||||
window_list_member = rb_hash_new ();
|
||||
|
||||
if (!NIL_P (window_list_member))
|
||||
{
|
||||
rb_hash_aset (window_list_member, rb_str_new2("num_buffer"),
|
||||
INT2FIX(ptr_window->num_buffer));
|
||||
INT2FIX(ptr_win->num_buffer));
|
||||
rb_hash_aset (window_list_member, rb_str_new2("win_x"),
|
||||
INT2FIX(ptr_window->win_x));
|
||||
INT2FIX(ptr_win->win_x));
|
||||
rb_hash_aset (window_list_member, rb_str_new2("win_y"),
|
||||
INT2FIX(ptr_window->win_y));
|
||||
INT2FIX(ptr_win->win_y));
|
||||
rb_hash_aset (window_list_member, rb_str_new2("win_width"),
|
||||
INT2FIX(ptr_window->win_width));
|
||||
INT2FIX(ptr_win->win_width));
|
||||
rb_hash_aset (window_list_member, rb_str_new2("win_height"),
|
||||
INT2FIX(ptr_window->win_height));
|
||||
INT2FIX(ptr_win->win_height));
|
||||
rb_hash_aset (window_list_member, rb_str_new2("win_width_pct"),
|
||||
INT2FIX(ptr_window->win_width_pct));
|
||||
INT2FIX(ptr_win->win_width_pct));
|
||||
rb_hash_aset (window_list_member, rb_str_new2("win_height_pct"),
|
||||
INT2FIX(ptr_window->win_height_pct));
|
||||
INT2FIX(ptr_win->win_height_pct));
|
||||
|
||||
rb_ary_push (window_list, window_list_member);
|
||||
}
|
||||
|
||||
@@ -86,7 +86,7 @@ struct t_plugin_server_info
|
||||
int autoconnect; /* = 1 if auto connect at startup */
|
||||
int autoreconnect; /* = 1 if auto reco when disconnected */
|
||||
int autoreconnect_delay; /* delay before trying again reconnect */
|
||||
int command_line; /* server was given on command line */
|
||||
int temp_server; /* server was given on command line */
|
||||
char *address; /* address of server (IP or name) */
|
||||
int port; /* port for server (6667 by default) */
|
||||
int ipv6; /* use IPv6 protocol */
|
||||
|
||||
+2
-1
@@ -1,10 +1,11 @@
|
||||
WeeChat - Wee Enhanced Environment for Chat
|
||||
===========================================
|
||||
|
||||
ChangeLog - 2007-08-06
|
||||
ChangeLog - 2007-08-08
|
||||
|
||||
|
||||
Version 0.2.6 (under dev!):
|
||||
* added "copy" and "rename" options to /server command
|
||||
* added key for setting unread marker on all buffers (default:
|
||||
ctrl-S + ctrl-U) (task 7180)
|
||||
* fixed nick prefix display on servers that doesn't support all prefixes
|
||||
|
||||
@@ -187,7 +187,7 @@
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>set_unread</literal></entry>
|
||||
<entry>set unread marker for all buffers</entry>
|
||||
<entry>set unread marker on all buffers</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>hotlist_clear</literal></entry>
|
||||
|
||||
@@ -167,7 +167,7 @@ Konfiguration abspeichern
|
||||
Datei: Name der zu speichernden Konfigurationsdatei
|
||||
|
||||
</programlisting>
|
||||
<command>server [list [servername]] | [listfull [servername]] | [servername hostname port [-auto | -noauto] [-ipv6] [-ssl] [-pwd password] [-nicks nick1 nick2 nick3] [-username username] [-realname realname] [-command command] [-autojoin channel[,channel]] ] | [del servername]</command>
|
||||
<command>server [list [servername]] | [listfull [servername]] | [servername hostname port [-auto | -noauto] [-ipv6] [-ssl] [-pwd password] [-nicks nick1 nick2 nick3] [-username username] [-realname realname] [-command command] [-autojoin channel[,channel]] ] | [copy server newservername] [rename servername newservername] [del servername]</command>
|
||||
<programlisting>
|
||||
Auflisten, Hinzufügen oder Entfernen von Servern
|
||||
|
||||
@@ -184,6 +184,8 @@ servername: server name, for internal and display use
|
||||
nick3: second alternate nick for server
|
||||
username: user name
|
||||
realname: real name of user
|
||||
copy: duplicate a server
|
||||
rename: rename a server
|
||||
del: delete a server
|
||||
|
||||
</programlisting>
|
||||
|
||||
@@ -187,7 +187,7 @@
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>set_unread</literal></entry>
|
||||
<entry>set unread marker for all buffers</entry>
|
||||
<entry>set unread marker on all buffers</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>hotlist_clear</literal></entry>
|
||||
|
||||
@@ -166,7 +166,7 @@ save config to disk
|
||||
file: filename for writing config
|
||||
|
||||
</programlisting>
|
||||
<command>server [list [servername]] | [listfull [servername]] | [servername hostname port [-auto | -noauto] [-ipv6] [-ssl] [-pwd password] [-nicks nick1 nick2 nick3] [-username username] [-realname realname] [-command command] [-autojoin channel[,channel]] ] | [del servername]</command>
|
||||
<command>server [list [servername]] | [listfull [servername]] | [servername hostname port [-auto | -noauto] [-ipv6] [-ssl] [-pwd password] [-nicks nick1 nick2 nick3] [-username username] [-realname realname] [-command command] [-autojoin channel[,channel]] ] | [copy server newservername] [rename servername newservername] [del servername]</command>
|
||||
<programlisting>
|
||||
list, add or remove servers
|
||||
|
||||
@@ -183,6 +183,8 @@ servername: server name, for internal and display use
|
||||
nick3: second alternate nick for server
|
||||
username: user name
|
||||
realname: real name of user
|
||||
copy: duplicate a server
|
||||
rename: rename a server
|
||||
del: delete a server
|
||||
|
||||
</programlisting>
|
||||
|
||||
@@ -187,7 +187,7 @@
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>set_unread</literal></entry>
|
||||
<entry>set unread marker for all buffers</entry>
|
||||
<entry>positionner le marqueur de données non lues sur tous les tampons</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>hotlist_clear</literal></entry>
|
||||
|
||||
@@ -166,7 +166,7 @@ sauvegarder la configuration sur disque
|
||||
fichier: fichier pour sauvegarder la configuration
|
||||
|
||||
</programlisting>
|
||||
<command>server [list [nom_serveur]] | [listfull [nom_serveur]] | [nom_serveur] | [nom_serveur nom/IP port [-auto | -noauto] [-ipv6] [-ssl] [-pwd mot_de_passe] [-nicks pseudo1 pseudo2 pseudo3] [-username nom_utilisateur] [-realname nom_réel] [-command commande] [-autojoin canal[,canal]] ] | [del nom_serveur]</command>
|
||||
<command>server [list [nom_serveur]] | [listfull [nom_serveur]] | [nom_serveur] | [nom_serveur nom/IP port [-auto | -noauto] [-ipv6] [-ssl] [-pwd mot_de_passe] [-nicks pseudo1 pseudo2 pseudo3] [-username nom_utilisateur] [-realname nom_réel] [-command commande] [-autojoin canal[,canal]] ] | [copy nom_serveur nouveau_nom_serveur] [rename nom_serveur nouveau_nom_serveur] [del nom_serveur]</command>
|
||||
<programlisting>
|
||||
liste, ajoute ou retire des serveurs
|
||||
|
||||
@@ -183,6 +183,8 @@ liste, ajoute ou retire des serveurs
|
||||
pseudo3: second pseudo alternatif pour le serveur
|
||||
nom_utilisateur: nom d'utilisateur
|
||||
nom_réel: nom réel de l'utilisateur
|
||||
copy: dupliquer un serveur
|
||||
rename: renommer un serveur
|
||||
del: supprimer un serveur
|
||||
|
||||
</programlisting>
|
||||
|
||||
+313
-311
File diff suppressed because it is too large
Load Diff
+313
-311
File diff suppressed because it is too large
Load Diff
+313
-319
File diff suppressed because it is too large
Load Diff
+317
-312
File diff suppressed because it is too large
Load Diff
+313
-318
File diff suppressed because it is too large
Load Diff
+313
-318
File diff suppressed because it is too large
Load Diff
+311
-296
File diff suppressed because it is too large
Load Diff
+107
-14
@@ -177,10 +177,11 @@ t_weechat_command weechat_commands[] =
|
||||
NULL, 0, 1, 0, weechat_cmd_save, NULL },
|
||||
{ "server", N_("list, add or remove servers"),
|
||||
N_("[list [servername]] | [listfull [servername]] | "
|
||||
"[servername hostname port [-auto | -noauto] [-ipv6] [-ssl] [-pwd password] [-nicks nick1 "
|
||||
"nick2 nick3] [-username username] [-realname realname] "
|
||||
"[-command command] [-autojoin channel[,channel]] ] | "
|
||||
"[del servername]"),
|
||||
"[servername hostname port [-auto | -noauto] [-ipv6] [-ssl] "
|
||||
"[-pwd password] [-nicks nick1 nick2 nick3] [-username username] "
|
||||
"[-realname realname] [-command command] [-autojoin channel[,channel]] ] | "
|
||||
"[copy server newservername] [rename servername newservername] [del "
|
||||
"servername]"),
|
||||
N_(" list: list servers (no parameter implies this list)\n"
|
||||
" listfull: list servers with detailed info for each server\n"
|
||||
"servername: server name, for internal and display use\n"
|
||||
@@ -194,8 +195,10 @@ t_weechat_command weechat_commands[] =
|
||||
" nick3: second alternate nick for server\n"
|
||||
" username: user name\n"
|
||||
" realname: real name of user\n"
|
||||
" copy: duplicate a server\n"
|
||||
" rename: rename a server\n"
|
||||
" del: delete a server"),
|
||||
"del|list|listfull", 0, MAX_ARGS, 0, weechat_cmd_server, NULL },
|
||||
"copy|rename|del|list|listfull %S %S", 0, MAX_ARGS, 0, weechat_cmd_server, NULL },
|
||||
{ "set", N_("set config options"),
|
||||
N_("[option [ = value]]"),
|
||||
N_("option: name of an option (if name is full "
|
||||
@@ -3022,23 +3025,113 @@ weechat_cmd_server (t_irc_server *server, t_irc_channel *channel,
|
||||
}
|
||||
else
|
||||
{
|
||||
if (ascii_strcasecmp (argv[0], "del") == 0)
|
||||
if (ascii_strcasecmp (argv[0], "copy") == 0)
|
||||
{
|
||||
if (argc < 3)
|
||||
{
|
||||
irc_display_prefix (NULL, NULL, PREFIX_ERROR);
|
||||
gui_printf (NULL,
|
||||
_("%s missing server name for \"%s\" command\n"),
|
||||
WEECHAT_ERROR, "server copy");
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* look for server by name */
|
||||
server_found = irc_server_search (argv[1]);
|
||||
if (!server_found)
|
||||
{
|
||||
irc_display_prefix (NULL, NULL, PREFIX_ERROR);
|
||||
gui_printf (NULL,
|
||||
_("%s server \"%s\" not found for \"%s\" command\n"),
|
||||
WEECHAT_ERROR, argv[1], "server copy");
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* check if target name already exists */
|
||||
if (irc_server_search (argv[2]))
|
||||
{
|
||||
irc_display_prefix (NULL, NULL, PREFIX_ERROR);
|
||||
gui_printf (NULL,
|
||||
_("%s server \"%s\" already exists for \"%s\" command\n"),
|
||||
WEECHAT_ERROR, argv[2], "server copy");
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* duplicate server */
|
||||
new_server = irc_server_duplicate (server_found, argv[2]);
|
||||
if (new_server)
|
||||
{
|
||||
irc_display_prefix (NULL, NULL, PREFIX_INFO);
|
||||
gui_printf (NULL, _("Server %s%s%s has been copied to %s%s\n"),
|
||||
GUI_COLOR(COLOR_WIN_CHAT_SERVER),
|
||||
argv[1],
|
||||
GUI_COLOR(COLOR_WIN_CHAT),
|
||||
GUI_COLOR(COLOR_WIN_CHAT_SERVER),
|
||||
argv[2]);
|
||||
gui_window_redraw_all_buffers ();
|
||||
return 0;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
if (ascii_strcasecmp (argv[0], "rename") == 0)
|
||||
{
|
||||
if (argc < 3)
|
||||
{
|
||||
irc_display_prefix (NULL, NULL, PREFIX_ERROR);
|
||||
gui_printf (NULL,
|
||||
_("%s missing server name for \"%s\" command\n"),
|
||||
WEECHAT_ERROR, "server rename");
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* look for server by name */
|
||||
server_found = irc_server_search (argv[1]);
|
||||
if (!server_found)
|
||||
{
|
||||
irc_display_prefix (NULL, NULL, PREFIX_ERROR);
|
||||
gui_printf (NULL,
|
||||
_("%s server \"%s\" not found for \"%s\" command\n"),
|
||||
WEECHAT_ERROR, argv[1], "server rename");
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* check if target name already exists */
|
||||
if (irc_server_search (argv[2]))
|
||||
{
|
||||
irc_display_prefix (NULL, NULL, PREFIX_ERROR);
|
||||
gui_printf (NULL,
|
||||
_("%s server \"%s\" already exists for \"%s\" command\n"),
|
||||
WEECHAT_ERROR, argv[2], "server rename");
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* rename server */
|
||||
if (irc_server_rename (server_found, argv[2]))
|
||||
{
|
||||
irc_display_prefix (NULL, NULL, PREFIX_INFO);
|
||||
gui_printf (NULL, _("Server %s%s%s has been renamed to %s%s\n"),
|
||||
GUI_COLOR(COLOR_WIN_CHAT_SERVER),
|
||||
argv[1],
|
||||
GUI_COLOR(COLOR_WIN_CHAT),
|
||||
GUI_COLOR(COLOR_WIN_CHAT_SERVER),
|
||||
argv[2]);
|
||||
gui_window_redraw_all_buffers ();
|
||||
return 0;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
else if (ascii_strcasecmp (argv[0], "del") == 0)
|
||||
{
|
||||
if (argc < 2)
|
||||
{
|
||||
irc_display_prefix (NULL, NULL, PREFIX_ERROR);
|
||||
gui_printf (NULL,
|
||||
_("%s missing servername for \"%s\" command\n"),
|
||||
_("%s missing server name for \"%s\" command\n"),
|
||||
WEECHAT_ERROR, "server del");
|
||||
return -1;
|
||||
}
|
||||
if (argc > 2)
|
||||
{
|
||||
irc_display_prefix (NULL, NULL, PREFIX_ERROR);
|
||||
gui_printf (NULL,
|
||||
_("%s too much arguments for \"%s\" command, ignoring arguments\n"),
|
||||
WEECHAT_WARNING, "server del");
|
||||
}
|
||||
|
||||
/* look for server by name */
|
||||
server_found = irc_server_search (argv[1]);
|
||||
|
||||
@@ -219,7 +219,7 @@ session_save_servers (FILE *file)
|
||||
rc = rc && (session_write_int (file, SESSION_SERV_AUTOCONNECT, ptr_server->autoconnect));
|
||||
rc = rc && (session_write_int (file, SESSION_SERV_AUTORECONNECT, ptr_server->autoreconnect));
|
||||
rc = rc && (session_write_int (file, SESSION_SERV_AUTORECONNECT_DELAY, ptr_server->autoreconnect_delay));
|
||||
rc = rc && (session_write_int (file, SESSION_SERV_COMMAND_LINE, ptr_server->command_line));
|
||||
rc = rc && (session_write_int (file, SESSION_SERV_TEMP_SERVER, ptr_server->temp_server));
|
||||
rc = rc && (session_write_str (file, SESSION_SERV_ADDRESS, ptr_server->address));
|
||||
rc = rc && (session_write_int (file, SESSION_SERV_PORT, ptr_server->port));
|
||||
rc = rc && (session_write_int (file, SESSION_SERV_IPV6, ptr_server->ipv6));
|
||||
@@ -881,8 +881,8 @@ session_load_server (FILE *file)
|
||||
case SESSION_SERV_AUTORECONNECT_DELAY:
|
||||
rc = rc && (session_read_int (file, &(session_current_server->autoreconnect_delay)));
|
||||
break;
|
||||
case SESSION_SERV_COMMAND_LINE:
|
||||
rc = rc && (session_read_int (file, &(session_current_server->command_line)));
|
||||
case SESSION_SERV_TEMP_SERVER:
|
||||
rc = rc && (session_read_int (file, &(session_current_server->temp_server)));
|
||||
break;
|
||||
case SESSION_SERV_ADDRESS:
|
||||
rc = rc && (session_read_str (file, &(session_current_server->address)));
|
||||
|
||||
@@ -54,7 +54,7 @@ enum t_session_server
|
||||
SESSION_SERV_AUTOCONNECT,
|
||||
SESSION_SERV_AUTORECONNECT,
|
||||
SESSION_SERV_AUTORECONNECT_DELAY,
|
||||
SESSION_SERV_COMMAND_LINE,
|
||||
SESSION_SERV_TEMP_SERVER,
|
||||
SESSION_SERV_ADDRESS,
|
||||
SESSION_SERV_PORT,
|
||||
SESSION_SERV_IPV6,
|
||||
|
||||
@@ -1188,10 +1188,7 @@ config_change_hotlist ()
|
||||
void
|
||||
config_change_read_marker ()
|
||||
{
|
||||
t_gui_window *ptr_win;
|
||||
|
||||
for (ptr_win = gui_windows; ptr_win; ptr_win = ptr_win->next_window)
|
||||
gui_window_redraw_buffer (ptr_win->buffer);
|
||||
gui_window_redraw_all_buffers ();
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -2526,7 +2523,7 @@ config_write (char *config_name)
|
||||
for (ptr_server = irc_servers; ptr_server;
|
||||
ptr_server = ptr_server->next_server)
|
||||
{
|
||||
if (!ptr_server->command_line)
|
||||
if (!ptr_server->temp_server)
|
||||
{
|
||||
weechat_iconv_fprintf (file, "\n[server]\n");
|
||||
weechat_iconv_fprintf (file, "server_name = \"%s\"\n", ptr_server->name);
|
||||
|
||||
@@ -430,6 +430,21 @@ gui_window_redraw_buffer (t_gui_buffer *buffer)
|
||||
gui_panel_redraw_buffer (buffer);
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_window_redraw_all_buffers: redraw all buffers
|
||||
*/
|
||||
|
||||
void
|
||||
gui_window_redraw_all_buffers ()
|
||||
{
|
||||
t_gui_window *ptr_win;
|
||||
|
||||
for (ptr_win = gui_windows; ptr_win; ptr_win = ptr_win->next_window)
|
||||
{
|
||||
gui_window_redraw_buffer (ptr_win->buffer);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_window_switch_to_buffer: switch to another buffer
|
||||
*/
|
||||
|
||||
@@ -156,6 +156,16 @@ gui_window_redraw_buffer (t_gui_buffer *buffer)
|
||||
(void) buffer;
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_window_redraw_all_buffers: redraw all buffers
|
||||
*/
|
||||
|
||||
void
|
||||
gui_window_redraw_all_buffers ()
|
||||
{
|
||||
/* TODO: write this function for Gtk */
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_window_switch_to_buffer: switch to another buffer
|
||||
*/
|
||||
|
||||
@@ -1405,7 +1405,6 @@ gui_action_scroll_unread (t_gui_window *window, char *args)
|
||||
void
|
||||
gui_action_set_unread (t_gui_window *window, char *args)
|
||||
{
|
||||
t_gui_window *ptr_win;
|
||||
t_gui_buffer *ptr_buffer;
|
||||
|
||||
/* make C compiler happy */
|
||||
@@ -1421,10 +1420,7 @@ gui_action_set_unread (t_gui_window *window, char *args)
|
||||
}
|
||||
|
||||
/* refresh all windows */
|
||||
for (ptr_win = gui_windows; ptr_win; ptr_win = ptr_win->next_window)
|
||||
{
|
||||
gui_window_redraw_buffer (ptr_win->buffer);
|
||||
}
|
||||
gui_window_redraw_all_buffers ();
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -250,6 +250,7 @@ extern int gui_window_objects_init (t_gui_window *);
|
||||
extern void gui_window_objects_free (t_gui_window *, int);
|
||||
extern int gui_window_calculate_pos_size (t_gui_window *, int);
|
||||
extern void gui_window_redraw_buffer (t_gui_buffer *);
|
||||
extern void gui_window_redraw_all_buffers ();
|
||||
extern void gui_window_switch_to_buffer (t_gui_window *, t_gui_buffer *);
|
||||
extern void gui_window_page_up (t_gui_window *);
|
||||
extern void gui_window_page_down (t_gui_window *);
|
||||
|
||||
@@ -396,7 +396,7 @@ irc_display_server (t_irc_server *server, int with_detail)
|
||||
|
||||
gui_printf (NULL, " server_autoconnect . . . . : %s%s\n",
|
||||
(server->autoconnect) ? _("on") : _("off"),
|
||||
(server->command_line) ?
|
||||
(server->temp_server) ?
|
||||
_(" (temporary server, will not be saved)") : "");
|
||||
gui_printf (NULL, " server_autoreconnect . . . : %s\n",
|
||||
(server->autoreconnect) ? _("on") : _("off"));
|
||||
@@ -478,6 +478,6 @@ irc_display_server (t_irc_server *server, int with_detail)
|
||||
gui_printf (NULL, "%s]%s%s\n",
|
||||
GUI_COLOR(COLOR_WIN_CHAT_DARK),
|
||||
GUI_COLOR(COLOR_WIN_CHAT),
|
||||
(server->command_line) ? _(" (temporary)") : "");
|
||||
(server->temp_server) ? _(" (temporary)") : "");
|
||||
}
|
||||
}
|
||||
|
||||
+11
-13
@@ -2742,7 +2742,7 @@ irc_recv_cmd_303 (t_irc_server *server, char *host, char *nick, char *arguments)
|
||||
int
|
||||
irc_recv_cmd_305 (t_irc_server *server, char *host, char *nick, char *arguments)
|
||||
{
|
||||
t_gui_window *ptr_window;
|
||||
t_gui_window *ptr_win;
|
||||
|
||||
/* make C compiler happy */
|
||||
(void) host;
|
||||
@@ -2763,11 +2763,10 @@ irc_recv_cmd_305 (t_irc_server *server, char *host, char *nick, char *arguments)
|
||||
}
|
||||
server->is_away = 0;
|
||||
server->away_time = 0;
|
||||
for (ptr_window = gui_windows; ptr_window;
|
||||
ptr_window = ptr_window->next_window)
|
||||
for (ptr_win = gui_windows; ptr_win; ptr_win = ptr_win->next_window)
|
||||
{
|
||||
if (SERVER(ptr_window->buffer) == server)
|
||||
gui_status_draw (ptr_window->buffer, 1);
|
||||
if (SERVER(ptr_win->buffer) == server)
|
||||
gui_status_draw (ptr_win->buffer, 1);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -2779,7 +2778,7 @@ irc_recv_cmd_305 (t_irc_server *server, char *host, char *nick, char *arguments)
|
||||
int
|
||||
irc_recv_cmd_306 (t_irc_server *server, char *host, char *nick, char *arguments)
|
||||
{
|
||||
t_gui_window *ptr_window;
|
||||
t_gui_window *ptr_win;
|
||||
|
||||
/* make C compiler happy */
|
||||
(void) host;
|
||||
@@ -2800,14 +2799,13 @@ irc_recv_cmd_306 (t_irc_server *server, char *host, char *nick, char *arguments)
|
||||
}
|
||||
server->is_away = 1;
|
||||
server->away_time = time (NULL);
|
||||
for (ptr_window = gui_windows; ptr_window;
|
||||
ptr_window = ptr_window->next_window)
|
||||
for (ptr_win = gui_windows; ptr_win; ptr_win = ptr_win->next_window)
|
||||
{
|
||||
if (SERVER(ptr_window->buffer) == server)
|
||||
gui_status_draw (ptr_window->buffer, 1);
|
||||
if (SERVER(ptr_window->buffer) == server)
|
||||
ptr_window->buffer->last_read_line =
|
||||
ptr_window->buffer->last_line;
|
||||
if (SERVER(ptr_win->buffer) == server)
|
||||
gui_status_draw (ptr_win->buffer, 1);
|
||||
if (SERVER(ptr_win->buffer) == server)
|
||||
ptr_win->buffer->last_read_line =
|
||||
ptr_win->buffer->last_line;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -85,7 +85,7 @@ irc_server_init (t_irc_server *server)
|
||||
server->autoconnect = 0;
|
||||
server->autoreconnect = 1;
|
||||
server->autoreconnect_delay = 30;
|
||||
server->command_line = 0;
|
||||
server->temp_server = 0;
|
||||
server->address = NULL;
|
||||
server->port = -1;
|
||||
server->ipv6 = 0;
|
||||
@@ -466,7 +466,7 @@ irc_server_free_all ()
|
||||
|
||||
t_irc_server *
|
||||
irc_server_new (char *name, int autoconnect, int autoreconnect,
|
||||
int autoreconnect_delay, int command_line, char *address,
|
||||
int autoreconnect_delay, int temp_server, char *address,
|
||||
int port, int ipv6, int ssl, char *password,
|
||||
char *nick1, char *nick2, char *nick3, char *username,
|
||||
char *realname, char *hostname, char *command, int command_delay,
|
||||
@@ -496,7 +496,7 @@ irc_server_new (char *name, int autoconnect, int autoreconnect,
|
||||
new_server->autoconnect = autoconnect;
|
||||
new_server->autoreconnect = autoreconnect;
|
||||
new_server->autoreconnect_delay = autoreconnect_delay;
|
||||
new_server->command_line = command_line;
|
||||
new_server->temp_server = temp_server;
|
||||
new_server->address = strdup (address);
|
||||
new_server->port = port;
|
||||
new_server->ipv6 = ipv6;
|
||||
@@ -525,8 +525,75 @@ irc_server_new (char *name, int autoconnect, int autoreconnect,
|
||||
return new_server;
|
||||
}
|
||||
|
||||
/*
|
||||
* irc_server_duplicate: duplicate a server
|
||||
* return: pointer to new server, NULL if error
|
||||
*/
|
||||
|
||||
t_irc_server *
|
||||
irc_server_duplicate (t_irc_server *server, char *new_name)
|
||||
{
|
||||
t_irc_server *new_server;
|
||||
|
||||
/* check if another server exists with this name */
|
||||
if (irc_server_search (new_name))
|
||||
return 0;
|
||||
|
||||
/* duplicate server */
|
||||
new_server = irc_server_new (new_name,
|
||||
server->autoconnect,
|
||||
server->autoreconnect,
|
||||
server->autoreconnect_delay,
|
||||
server->temp_server,
|
||||
server->address,
|
||||
server->port,
|
||||
server->ipv6,
|
||||
server->ssl,
|
||||
server->password,
|
||||
server->nick1,
|
||||
server->nick2,
|
||||
server->nick3,
|
||||
server->username,
|
||||
server->realname,
|
||||
server->hostname,
|
||||
server->command,
|
||||
server->command_delay,
|
||||
server->autojoin,
|
||||
server->autorejoin,
|
||||
server->notify_levels);
|
||||
|
||||
return new_server;
|
||||
}
|
||||
|
||||
/*
|
||||
* irc_server_rename: rename server (internal name)
|
||||
* return: 1 if ok, 0 if error
|
||||
*/
|
||||
|
||||
int
|
||||
irc_server_rename (t_irc_server *server, char *new_name)
|
||||
{
|
||||
char *str;
|
||||
|
||||
/* check if another server exists with this name */
|
||||
if (irc_server_search (new_name))
|
||||
return 0;
|
||||
|
||||
/* rename server */
|
||||
str = strdup (new_name);
|
||||
if (str)
|
||||
{
|
||||
if (server->name)
|
||||
free (server->name);
|
||||
server->name = str;
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* irc_server_send: send data to IRC server
|
||||
* return number of bytes sent, -1 if error
|
||||
*/
|
||||
|
||||
int
|
||||
@@ -1911,15 +1978,15 @@ irc_server_reconnect (t_irc_server *server)
|
||||
*/
|
||||
|
||||
void
|
||||
irc_server_auto_connect (int auto_connect, int command_line)
|
||||
irc_server_auto_connect (int auto_connect, int temp_server)
|
||||
{
|
||||
t_irc_server *ptr_server;
|
||||
|
||||
for (ptr_server = irc_servers; ptr_server;
|
||||
ptr_server = ptr_server->next_server)
|
||||
{
|
||||
if ( ((command_line) && (ptr_server->command_line))
|
||||
|| ((!command_line) && (auto_connect) && (ptr_server->autoconnect)) )
|
||||
if ( ((temp_server) && (ptr_server->temp_server))
|
||||
|| ((!temp_server) && (auto_connect) && (ptr_server->autoconnect)) )
|
||||
{
|
||||
(void) gui_buffer_new (gui_current_window, ptr_server, NULL,
|
||||
BUFFER_TYPE_STANDARD, 1);
|
||||
@@ -2255,7 +2322,7 @@ irc_server_print_log (t_irc_server *server)
|
||||
weechat_log_printf (" autoconnect . . . . : %d\n", server->autoconnect);
|
||||
weechat_log_printf (" autoreconnect . . . : %d\n", server->autoreconnect);
|
||||
weechat_log_printf (" autoreconnect_delay : %d\n", server->autoreconnect_delay);
|
||||
weechat_log_printf (" command_line. . . . : %d\n", server->command_line);
|
||||
weechat_log_printf (" temp_server . . . . : %d\n", server->temp_server);
|
||||
weechat_log_printf (" address . . . . . . : '%s'\n", server->address);
|
||||
weechat_log_printf (" port. . . . . . . . : %d\n", server->port);
|
||||
weechat_log_printf (" ipv6. . . . . . . . : %d\n", server->ipv6);
|
||||
|
||||
@@ -146,11 +146,11 @@ typedef struct t_irc_server t_irc_server;
|
||||
struct t_irc_server
|
||||
{
|
||||
/* user choices */
|
||||
char *name; /* name of server (only for display) */
|
||||
char *name; /* internal name of server */
|
||||
int autoconnect; /* = 1 if auto connect at startup */
|
||||
int autoreconnect; /* = 1 if auto reco when disconnected */
|
||||
int autoreconnect_delay; /* delay before trying again reconnect */
|
||||
int command_line; /* server was given on command line */
|
||||
int temp_server; /* server is temporary (will not be saved)*/
|
||||
char *address; /* address of server (IP or name) */
|
||||
int port; /* port for server (6667 by default) */
|
||||
int ipv6; /* use IPv6 protocol */
|
||||
@@ -373,9 +373,8 @@ extern void irc_server_free_all ();
|
||||
extern t_irc_server *irc_server_new (char *, int, int, int, int, char *, int, int, int,
|
||||
char *, char *, char *, char *, char *, char *,
|
||||
char *, char *, int, char *, int, char *);
|
||||
extern char *irc_server_get_charset_decode_iso (t_irc_server *);
|
||||
extern char *irc_server_get_charset_decode_utf (t_irc_server *);
|
||||
extern char *irc_server_get_charset_encode (t_irc_server *);
|
||||
extern t_irc_server *irc_server_duplicate (t_irc_server *, char *);
|
||||
extern int irc_server_rename (t_irc_server *, char *);
|
||||
extern int irc_server_send (t_irc_server *, char *, int);
|
||||
extern void irc_server_outqueue_send (t_irc_server *);
|
||||
extern void irc_server_sendf (t_irc_server *, char *, ...);
|
||||
|
||||
@@ -916,7 +916,7 @@ weechat_plugin_get_server_info (t_weechat_plugin *plugin)
|
||||
new_server_info->autoconnect = ptr_server->autoconnect;
|
||||
new_server_info->autoreconnect = ptr_server->autoreconnect;
|
||||
new_server_info->autoreconnect_delay = ptr_server->autoreconnect_delay;
|
||||
new_server_info->command_line = ptr_server->command_line;
|
||||
new_server_info->temp_server = ptr_server->temp_server;
|
||||
new_server_info->address = (ptr_server->address) ? strdup (ptr_server->address) : strdup ("");
|
||||
new_server_info->port = ptr_server->port;
|
||||
new_server_info->ipv6 = ptr_server->ipv6;
|
||||
@@ -1246,7 +1246,7 @@ t_plugin_window_info *
|
||||
weechat_plugin_get_window_info (t_weechat_plugin *plugin)
|
||||
{
|
||||
t_plugin_window_info *window_info, *last_window_info, *new_window_info;
|
||||
t_gui_window *ptr_window;
|
||||
t_gui_window *ptr_win;
|
||||
|
||||
if (!plugin)
|
||||
return NULL;
|
||||
@@ -1255,18 +1255,18 @@ weechat_plugin_get_window_info (t_weechat_plugin *plugin)
|
||||
{
|
||||
window_info = NULL;
|
||||
last_window_info = NULL;
|
||||
for (ptr_window = gui_windows; ptr_window; ptr_window = ptr_window->next_window)
|
||||
for (ptr_win = gui_windows; ptr_win; ptr_win = ptr_win->next_window)
|
||||
{
|
||||
new_window_info = (t_plugin_window_info *) malloc (sizeof (t_plugin_window_info));
|
||||
if (new_window_info)
|
||||
{
|
||||
new_window_info->win_x = ptr_window->win_x;
|
||||
new_window_info->win_y = ptr_window->win_y;
|
||||
new_window_info->win_width = ptr_window->win_width;
|
||||
new_window_info->win_height = ptr_window->win_height;
|
||||
new_window_info->win_width_pct = ptr_window->win_width_pct;
|
||||
new_window_info->win_height_pct = ptr_window->win_height_pct;
|
||||
new_window_info->num_buffer = (ptr_window->buffer) ? ptr_window->buffer->number : 0;
|
||||
new_window_info->win_x = ptr_win->win_x;
|
||||
new_window_info->win_y = ptr_win->win_y;
|
||||
new_window_info->win_width = ptr_win->win_width;
|
||||
new_window_info->win_height = ptr_win->win_height;
|
||||
new_window_info->win_width_pct = ptr_win->win_width_pct;
|
||||
new_window_info->win_height_pct = ptr_win->win_height_pct;
|
||||
new_window_info->num_buffer = (ptr_win->buffer) ? ptr_win->buffer->number : 0;
|
||||
|
||||
new_window_info->prev_window = last_window_info;
|
||||
new_window_info->next_window = NULL;
|
||||
|
||||
@@ -1672,8 +1672,8 @@ weechat_lua_get_server_info (lua_State *L)
|
||||
lua_pushnumber (lua_current_interpreter, ptr_server->autoreconnect_delay);
|
||||
lua_rawset (lua_current_interpreter, -3);
|
||||
|
||||
lua_pushstring (lua_current_interpreter, "command_line");
|
||||
lua_pushnumber (lua_current_interpreter, ptr_server->command_line);
|
||||
lua_pushstring (lua_current_interpreter, "temp_server");
|
||||
lua_pushnumber (lua_current_interpreter, ptr_server->temp_server);
|
||||
lua_rawset (lua_current_interpreter, -3);
|
||||
|
||||
lua_pushstring (lua_current_interpreter, "address");
|
||||
@@ -1973,7 +1973,7 @@ weechat_lua_get_irc_color (lua_State *L)
|
||||
static int
|
||||
weechat_lua_get_window_info (lua_State *L)
|
||||
{
|
||||
t_plugin_window_info *window_info, *ptr_window;
|
||||
t_plugin_window_info *window_info, *ptr_win;
|
||||
int i;
|
||||
|
||||
/* make C compiler happy */
|
||||
@@ -1997,40 +1997,43 @@ weechat_lua_get_window_info (lua_State *L)
|
||||
|
||||
lua_newtable (lua_current_interpreter);
|
||||
|
||||
for (i = 0, ptr_window = window_info; ptr_window; ptr_window = ptr_window->next_window, i++)
|
||||
i = 0;
|
||||
for (ptr_win = window_info; ptr_win; ptr_win = ptr_win->next_window)
|
||||
{
|
||||
lua_pushnumber (lua_current_interpreter, i);
|
||||
lua_newtable (lua_current_interpreter);
|
||||
|
||||
lua_pushstring (lua_current_interpreter, "num_buffer");
|
||||
lua_pushnumber (lua_current_interpreter, ptr_window->num_buffer);
|
||||
lua_pushnumber (lua_current_interpreter, ptr_win->num_buffer);
|
||||
lua_rawset (lua_current_interpreter, -3);
|
||||
|
||||
lua_pushstring (lua_current_interpreter, "win_x");
|
||||
lua_pushnumber (lua_current_interpreter, ptr_window->win_x);
|
||||
lua_pushnumber (lua_current_interpreter, ptr_win->win_x);
|
||||
lua_rawset (lua_current_interpreter, -3);
|
||||
|
||||
lua_pushstring (lua_current_interpreter, "win_y");
|
||||
lua_pushnumber (lua_current_interpreter, ptr_window->win_y);
|
||||
lua_pushnumber (lua_current_interpreter, ptr_win->win_y);
|
||||
lua_rawset (lua_current_interpreter, -3);
|
||||
|
||||
lua_pushstring (lua_current_interpreter, "win_width");
|
||||
lua_pushnumber (lua_current_interpreter, ptr_window->win_width);
|
||||
lua_pushnumber (lua_current_interpreter, ptr_win->win_width);
|
||||
lua_rawset (lua_current_interpreter, -3);
|
||||
|
||||
lua_pushstring (lua_current_interpreter, "win_height");
|
||||
lua_pushnumber (lua_current_interpreter, ptr_window->win_height);
|
||||
lua_pushnumber (lua_current_interpreter, ptr_win->win_height);
|
||||
lua_rawset (lua_current_interpreter, -3);
|
||||
|
||||
lua_pushstring (lua_current_interpreter, "win_width_pct");
|
||||
lua_pushnumber (lua_current_interpreter, ptr_window->win_width_pct);
|
||||
lua_pushnumber (lua_current_interpreter, ptr_win->win_width_pct);
|
||||
lua_rawset (lua_current_interpreter, -3);
|
||||
|
||||
lua_pushstring (lua_current_interpreter, "win_height_pct");
|
||||
lua_pushnumber (lua_current_interpreter, ptr_window->win_height_pct);
|
||||
lua_pushnumber (lua_current_interpreter, ptr_win->win_height_pct);
|
||||
lua_rawset (lua_current_interpreter, -3);
|
||||
|
||||
lua_rawset (lua_current_interpreter, -3);
|
||||
|
||||
i++;
|
||||
}
|
||||
|
||||
lua_plugin->free_window_info (lua_plugin, window_info);
|
||||
|
||||
@@ -1465,7 +1465,7 @@ static XS (XS_weechat_get_server_info)
|
||||
hv_store (server_hash_member, "autoconnect", 11, newSViv (ptr_server->autoconnect), 0);
|
||||
hv_store (server_hash_member, "autoreconnect", 13, newSViv (ptr_server->autoreconnect), 0);
|
||||
hv_store (server_hash_member, "autoreconnect_delay", 19, newSViv (ptr_server->autoreconnect_delay), 0);
|
||||
hv_store (server_hash_member, "command_line", 12, newSViv (ptr_server->command_line), 0);
|
||||
hv_store (server_hash_member, "temp_server", 11, newSViv (ptr_server->temp_server), 0);
|
||||
hv_store (server_hash_member, "address", 7, newSVpv (ptr_server->address, 0), 0);
|
||||
hv_store (server_hash_member, "port", 4, newSViv (ptr_server->port), 0);
|
||||
hv_store (server_hash_member, "ipv6", 4, newSViv (ptr_server->ipv6), 0);
|
||||
@@ -1717,7 +1717,7 @@ static XS (XS_weechat_get_irc_color)
|
||||
|
||||
static XS (XS_weechat_get_window_info)
|
||||
{
|
||||
t_plugin_window_info *window_info, *ptr_window;
|
||||
t_plugin_window_info *window_info, *ptr_win;
|
||||
int count;
|
||||
HV *window_hash_member;
|
||||
dXSARGS;
|
||||
@@ -1739,17 +1739,17 @@ static XS (XS_weechat_get_window_info)
|
||||
if (!window_info)
|
||||
XSRETURN_EMPTY;
|
||||
|
||||
for (ptr_window = window_info; ptr_window; ptr_window = ptr_window->next_window)
|
||||
for (ptr_win = window_info; ptr_win; ptr_win = ptr_win->next_window)
|
||||
{
|
||||
window_hash_member = (HV *) sv_2mortal((SV *) newHV());
|
||||
|
||||
hv_store (window_hash_member, "num_buffer", 10, newSViv (ptr_window->num_buffer), 0);
|
||||
hv_store (window_hash_member, "win_x", 5, newSViv (ptr_window->win_x), 0);
|
||||
hv_store (window_hash_member, "win_y", 5, newSViv (ptr_window->win_y), 0);
|
||||
hv_store (window_hash_member, "win_width", 9, newSViv (ptr_window->win_width), 0);
|
||||
hv_store (window_hash_member, "win_height", 10, newSViv (ptr_window->win_height), 0);
|
||||
hv_store (window_hash_member, "win_width_pct", 13, newSViv (ptr_window->win_width_pct), 0);
|
||||
hv_store (window_hash_member, "win_height_pct", 14, newSViv (ptr_window->win_height_pct), 0);
|
||||
hv_store (window_hash_member, "num_buffer", 10, newSViv (ptr_win->num_buffer), 0);
|
||||
hv_store (window_hash_member, "win_x", 5, newSViv (ptr_win->win_x), 0);
|
||||
hv_store (window_hash_member, "win_y", 5, newSViv (ptr_win->win_y), 0);
|
||||
hv_store (window_hash_member, "win_width", 9, newSViv (ptr_win->win_width), 0);
|
||||
hv_store (window_hash_member, "win_height", 10, newSViv (ptr_win->win_height), 0);
|
||||
hv_store (window_hash_member, "win_width_pct", 13, newSViv (ptr_win->win_width_pct), 0);
|
||||
hv_store (window_hash_member, "win_height_pct", 14, newSViv (ptr_win->win_height_pct), 0);
|
||||
|
||||
XPUSHs(newRV_inc((SV *) window_hash_member));
|
||||
count++;
|
||||
|
||||
@@ -1495,8 +1495,8 @@ weechat_python_get_server_info (PyObject *self, PyObject *args)
|
||||
Py_DECREF (key);
|
||||
Py_DECREF (value);
|
||||
|
||||
key = Py_BuildValue("s", "command_line");
|
||||
value = Py_BuildValue("i", ptr_server->command_line);
|
||||
key = Py_BuildValue("s", "temp_server");
|
||||
value = Py_BuildValue("i", ptr_server->temp_server);
|
||||
PyDict_SetItem(server_hash_member, key, value);
|
||||
Py_DECREF (key);
|
||||
Py_DECREF (value);
|
||||
@@ -1856,7 +1856,7 @@ weechat_python_get_irc_color (PyObject *self, PyObject *args)
|
||||
static PyObject *
|
||||
weechat_python_get_window_info (PyObject *self, PyObject *args)
|
||||
{
|
||||
t_plugin_window_info *window_info, *ptr_window;
|
||||
t_plugin_window_info *window_info, *ptr_win;
|
||||
PyObject *window_list, *window_list_member, *key, *value;
|
||||
|
||||
/* make C compiler happy */
|
||||
@@ -1879,53 +1879,53 @@ weechat_python_get_window_info (PyObject *self, PyObject *args)
|
||||
}
|
||||
|
||||
window_info = python_plugin->get_window_info (python_plugin);
|
||||
if (!window_info)
|
||||
if (!window_info)
|
||||
return window_list;
|
||||
|
||||
for(ptr_window = window_info; ptr_window; ptr_window = ptr_window->next_window)
|
||||
for (ptr_win = window_info; ptr_win; ptr_win = ptr_win->next_window)
|
||||
{
|
||||
window_list_member = PyDict_New();
|
||||
|
||||
if (window_list_member)
|
||||
{
|
||||
key = Py_BuildValue("s", "num_buffer");
|
||||
value = Py_BuildValue("i", ptr_window->num_buffer);
|
||||
value = Py_BuildValue("i", ptr_win->num_buffer);
|
||||
PyDict_SetItem(window_list_member, key, value);
|
||||
Py_DECREF (key);
|
||||
Py_DECREF (value);
|
||||
|
||||
key = Py_BuildValue("s", "win_x");
|
||||
value = Py_BuildValue("i", ptr_window->win_x);
|
||||
value = Py_BuildValue("i", ptr_win->win_x);
|
||||
PyDict_SetItem(window_list_member, key, value);
|
||||
Py_DECREF (key);
|
||||
Py_DECREF (value);
|
||||
|
||||
key = Py_BuildValue("s", "win_y");
|
||||
value = Py_BuildValue("i", ptr_window->win_y);
|
||||
value = Py_BuildValue("i", ptr_win->win_y);
|
||||
PyDict_SetItem(window_list_member, key, value);
|
||||
Py_DECREF (key);
|
||||
Py_DECREF (value);
|
||||
|
||||
key = Py_BuildValue("s", "win_width");
|
||||
value = Py_BuildValue("i", ptr_window->win_width);
|
||||
value = Py_BuildValue("i", ptr_win->win_width);
|
||||
PyDict_SetItem(window_list_member, key, value);
|
||||
Py_DECREF (key);
|
||||
Py_DECREF (value);
|
||||
|
||||
key = Py_BuildValue("s", "win_height");
|
||||
value = Py_BuildValue("i", ptr_window->win_height);
|
||||
value = Py_BuildValue("i", ptr_win->win_height);
|
||||
PyDict_SetItem(window_list_member, key, value);
|
||||
Py_DECREF (key);
|
||||
Py_DECREF (value);
|
||||
|
||||
key = Py_BuildValue("s", "win_width_pct");
|
||||
value = Py_BuildValue("i", ptr_window->win_width_pct);
|
||||
value = Py_BuildValue("i", ptr_win->win_width_pct);
|
||||
PyDict_SetItem(window_list_member, key, value);
|
||||
Py_DECREF (key);
|
||||
Py_DECREF (value);
|
||||
|
||||
key = Py_BuildValue("s", "win_height_pct");
|
||||
value = Py_BuildValue("i", ptr_window->win_height_pct);
|
||||
value = Py_BuildValue("i", ptr_win->win_height_pct);
|
||||
PyDict_SetItem(window_list_member, key, value);
|
||||
Py_DECREF (key);
|
||||
Py_DECREF (value);
|
||||
|
||||
@@ -1669,8 +1669,8 @@ weechat_ruby_get_server_info (VALUE class)
|
||||
INT2FIX(ptr_server->autoreconnect));
|
||||
rb_hash_aset (server_hash_member, rb_str_new2("autoreconnect_delay"),
|
||||
INT2FIX(ptr_server->autoreconnect_delay));
|
||||
rb_hash_aset (server_hash_member, rb_str_new2("command_line"),
|
||||
INT2FIX(ptr_server->command_line));
|
||||
rb_hash_aset (server_hash_member, rb_str_new2("temp_server"),
|
||||
INT2FIX(ptr_server->temp_server));
|
||||
rb_hash_aset (server_hash_member, rb_str_new2("address"),
|
||||
rb_str_new2(ptr_server->address));
|
||||
rb_hash_aset (server_hash_member, rb_str_new2("port"),
|
||||
@@ -1910,7 +1910,7 @@ weechat_ruby_get_irc_color (VALUE class, VALUE color)
|
||||
static VALUE
|
||||
weechat_ruby_get_window_info (VALUE class)
|
||||
{
|
||||
t_plugin_window_info *window_info, *ptr_window;
|
||||
t_plugin_window_info *window_info, *ptr_win;
|
||||
VALUE window_list, window_list_member;
|
||||
|
||||
/* make C compiler happy */
|
||||
@@ -1933,26 +1933,26 @@ weechat_ruby_get_window_info (VALUE class)
|
||||
if (!window_info)
|
||||
return window_list;
|
||||
|
||||
for(ptr_window = window_info; ptr_window; ptr_window = ptr_window->next_window)
|
||||
for (ptr_win = window_info; ptr_win; ptr_win = ptr_win->next_window)
|
||||
{
|
||||
window_list_member = rb_hash_new ();
|
||||
|
||||
if (!NIL_P (window_list_member))
|
||||
{
|
||||
rb_hash_aset (window_list_member, rb_str_new2("num_buffer"),
|
||||
INT2FIX(ptr_window->num_buffer));
|
||||
INT2FIX(ptr_win->num_buffer));
|
||||
rb_hash_aset (window_list_member, rb_str_new2("win_x"),
|
||||
INT2FIX(ptr_window->win_x));
|
||||
INT2FIX(ptr_win->win_x));
|
||||
rb_hash_aset (window_list_member, rb_str_new2("win_y"),
|
||||
INT2FIX(ptr_window->win_y));
|
||||
INT2FIX(ptr_win->win_y));
|
||||
rb_hash_aset (window_list_member, rb_str_new2("win_width"),
|
||||
INT2FIX(ptr_window->win_width));
|
||||
INT2FIX(ptr_win->win_width));
|
||||
rb_hash_aset (window_list_member, rb_str_new2("win_height"),
|
||||
INT2FIX(ptr_window->win_height));
|
||||
INT2FIX(ptr_win->win_height));
|
||||
rb_hash_aset (window_list_member, rb_str_new2("win_width_pct"),
|
||||
INT2FIX(ptr_window->win_width_pct));
|
||||
INT2FIX(ptr_win->win_width_pct));
|
||||
rb_hash_aset (window_list_member, rb_str_new2("win_height_pct"),
|
||||
INT2FIX(ptr_window->win_height_pct));
|
||||
INT2FIX(ptr_win->win_height_pct));
|
||||
|
||||
rb_ary_push (window_list, window_list_member);
|
||||
}
|
||||
|
||||
@@ -86,7 +86,7 @@ struct t_plugin_server_info
|
||||
int autoconnect; /* = 1 if auto connect at startup */
|
||||
int autoreconnect; /* = 1 if auto reco when disconnected */
|
||||
int autoreconnect_delay; /* delay before trying again reconnect */
|
||||
int command_line; /* server was given on command line */
|
||||
int temp_server; /* server was given on command line */
|
||||
char *address; /* address of server (IP or name) */
|
||||
int port; /* port for server (6667 by default) */
|
||||
int ipv6; /* use IPv6 protocol */
|
||||
|
||||
Reference in New Issue
Block a user