1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-10 03:33:12 +02:00

irc: add support of fake servers (no I/O, for testing purposes)

This commit is contained in:
Sébastien Helleu
2020-03-09 21:09:55 +01:00
parent 3590302183
commit 8a5046f0a1
25 changed files with 353 additions and 258 deletions
+6 -2
View File
@@ -29,7 +29,9 @@ struct t_irc_channel;
struct t_gui_buffer *buffer, \
int argc, char **argv, char **argv_eol)
#define IRC_COMMAND_CHECK_SERVER(__command, __check_connection) \
#define IRC_COMMAND_CHECK_SERVER(__command, \
__check_connection, \
__check_socket) \
if (!ptr_server) \
{ \
weechat_printf (NULL, \
@@ -39,7 +41,9 @@ struct t_irc_channel;
__command); \
return WEECHAT_RC_OK; \
} \
if (__check_connection && !ptr_server->is_connected) \
if ((__check_connection && !ptr_server->is_connected) \
|| (__check_socket && !ptr_server->fake_server \
&& (ptr_server->sock < 0))) \
{ \
weechat_printf (NULL, \
_("%s%s: command \"%s\" must be executed on " \