mirror of
https://github.com/weechat/weechat.git
synced 2026-07-07 10:13:12 +02:00
This commit is contained in:
+236
-299
@@ -354,6 +354,165 @@ irc_command_mode_masks (struct t_irc_server *server,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Sends a CTCP ACTION to a channel for a single message
|
||||
* (internal function called by irc_command_me_channel).
|
||||
*/
|
||||
|
||||
void
|
||||
irc_command_me_channel_message (struct t_irc_server *server,
|
||||
const char *channel_name,
|
||||
const char *message)
|
||||
{
|
||||
struct t_arraylist *list_messages;
|
||||
int i, list_size;
|
||||
|
||||
list_messages = irc_server_sendf (
|
||||
server,
|
||||
IRC_SERVER_SEND_OUTQ_PRIO_HIGH | IRC_SERVER_SEND_RETURN_LIST,
|
||||
NULL,
|
||||
"PRIVMSG %s :\01ACTION%s%s\01",
|
||||
channel_name,
|
||||
(message && message[0]) ? " " : "",
|
||||
(message && message[0]) ? message : "");
|
||||
if (list_messages)
|
||||
{
|
||||
/* display only if capability "echo-message" is NOT enabled */
|
||||
if (!weechat_hashtable_has_key (server->cap_list, "echo-message"))
|
||||
{
|
||||
list_size = weechat_arraylist_size (list_messages);
|
||||
for (i = 0; i < list_size; i++)
|
||||
{
|
||||
irc_input_user_message_display (
|
||||
server,
|
||||
channel_name,
|
||||
NULL, /* address */
|
||||
"privmsg",
|
||||
"action",
|
||||
(const char *)weechat_arraylist_get (list_messages, i),
|
||||
1); /* decode_colors */
|
||||
}
|
||||
}
|
||||
weechat_arraylist_free (list_messages);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Sends a CTCP ACTION to a channel.
|
||||
*/
|
||||
|
||||
void
|
||||
irc_command_me_channel (struct t_irc_server *server,
|
||||
const char *channel_name,
|
||||
const char *arguments)
|
||||
{
|
||||
char **list_arguments;
|
||||
int i, count_arguments;
|
||||
|
||||
list_arguments = weechat_string_split ((arguments) ? arguments : "",
|
||||
"\n", NULL, 0, 0, &count_arguments);
|
||||
if (list_arguments)
|
||||
{
|
||||
for (i = 0; i < count_arguments; i++)
|
||||
{
|
||||
irc_command_me_channel_message (server, channel_name,
|
||||
list_arguments[i]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
irc_command_me_channel_message (server, channel_name, "");
|
||||
}
|
||||
|
||||
weechat_string_free_split (list_arguments);
|
||||
}
|
||||
|
||||
/*
|
||||
* Sends a CTCP ACTION to all channels of a server.
|
||||
*/
|
||||
|
||||
void
|
||||
irc_command_me_all_channels (struct t_irc_server *server, const char *arguments)
|
||||
{
|
||||
struct t_irc_channel *ptr_channel;
|
||||
|
||||
for (ptr_channel = server->channels; ptr_channel;
|
||||
ptr_channel = ptr_channel->next_channel)
|
||||
{
|
||||
if (ptr_channel->type == IRC_CHANNEL_TYPE_CHANNEL)
|
||||
irc_command_me_channel (server, ptr_channel->name, arguments);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Callback for command "/action": sends an action message to a nick or channel.
|
||||
*/
|
||||
|
||||
IRC_COMMAND_CALLBACK(action)
|
||||
{
|
||||
char **targets;
|
||||
int num_targets, i, arg_target, arg_text;
|
||||
|
||||
IRC_BUFFER_GET_SERVER_CHANNEL(buffer);
|
||||
|
||||
/* make C compiler happy */
|
||||
(void) pointer;
|
||||
(void) data;
|
||||
|
||||
WEECHAT_COMMAND_MIN_ARGS(2, "");
|
||||
|
||||
arg_target = 1;
|
||||
arg_text = 2;
|
||||
|
||||
if ((argc >= 5) && (weechat_strcmp (argv[1], "-server") == 0))
|
||||
{
|
||||
ptr_server = irc_server_search (argv[2]);
|
||||
ptr_channel = NULL;
|
||||
arg_target = 3;
|
||||
arg_text = 4;
|
||||
}
|
||||
|
||||
IRC_COMMAND_CHECK_SERVER("action", 1, 1);
|
||||
|
||||
targets = weechat_string_split (argv[arg_target], ",", NULL,
|
||||
WEECHAT_STRING_SPLIT_STRIP_LEFT
|
||||
| WEECHAT_STRING_SPLIT_STRIP_RIGHT
|
||||
| WEECHAT_STRING_SPLIT_COLLAPSE_SEPS,
|
||||
0, &num_targets);
|
||||
if (!targets)
|
||||
WEECHAT_COMMAND_ERROR;
|
||||
|
||||
for (i = 0; i < num_targets; i++)
|
||||
{
|
||||
if (strcmp (targets[i], "*") == 0)
|
||||
{
|
||||
if (!ptr_channel
|
||||
|| ((ptr_channel->type != IRC_CHANNEL_TYPE_CHANNEL)
|
||||
&& (ptr_channel->type != IRC_CHANNEL_TYPE_PRIVATE)))
|
||||
{
|
||||
weechat_printf (
|
||||
ptr_server->buffer,
|
||||
_("%s%s: \"%s\" command can only be executed in a channel "
|
||||
"or private buffer"),
|
||||
weechat_prefix ("error"), IRC_PLUGIN_NAME, "action *");
|
||||
}
|
||||
else
|
||||
{
|
||||
irc_command_me_channel (ptr_server, ptr_channel->name,
|
||||
argv_eol[arg_text]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
irc_command_me_channel (ptr_server, targets[i], argv_eol[arg_text]);
|
||||
}
|
||||
}
|
||||
|
||||
weechat_string_free_split (targets);
|
||||
|
||||
return WEECHAT_RC_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
* Callback for command "/admin": finds information about the administrator of
|
||||
* the server.
|
||||
@@ -1060,130 +1219,6 @@ end:
|
||||
return WEECHAT_RC_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
* Displays a ctcp action on a channel.
|
||||
*/
|
||||
|
||||
void
|
||||
irc_command_me_channel_display (struct t_irc_server *server,
|
||||
struct t_irc_channel *channel,
|
||||
const char *arguments)
|
||||
{
|
||||
char *string;
|
||||
struct t_irc_nick *ptr_nick;
|
||||
|
||||
/*
|
||||
* if capability "echo-message" is enabled, we don't display anything,
|
||||
* the message will be displayed when server sends it back to us
|
||||
*/
|
||||
if (weechat_hashtable_has_key (server->cap_list, "echo-message"))
|
||||
return;
|
||||
|
||||
string = (arguments && arguments[0]) ?
|
||||
irc_color_decode (arguments,
|
||||
weechat_config_boolean (irc_config_network_colors_send)) : NULL;
|
||||
ptr_nick = irc_nick_search (server, channel, server->nick);
|
||||
weechat_printf_date_tags (
|
||||
channel->buffer,
|
||||
0,
|
||||
irc_protocol_tags (server,
|
||||
"privmsg",
|
||||
NULL,
|
||||
"irc_action,self_msg,notify_none,no_highlight",
|
||||
server->nick, NULL),
|
||||
"%s%s%s%s%s%s%s",
|
||||
weechat_prefix ("action"),
|
||||
irc_nick_mode_for_display (server, ptr_nick, 0),
|
||||
IRC_COLOR_CHAT_NICK_SELF,
|
||||
server->nick,
|
||||
(string) ? IRC_COLOR_RESET : "",
|
||||
(string) ? " " : "",
|
||||
(string) ? string : "");
|
||||
if (string)
|
||||
free (string);
|
||||
}
|
||||
|
||||
/*
|
||||
* Sends a ctcp action to a channel for a single message
|
||||
* (internal function called by irc_command_me_channel).
|
||||
*/
|
||||
|
||||
void
|
||||
irc_command_me_channel_message (struct t_irc_server *server,
|
||||
struct t_irc_channel *channel,
|
||||
const char *message)
|
||||
{
|
||||
struct t_arraylist *list_messages;
|
||||
int i, list_size;
|
||||
|
||||
list_messages = irc_server_sendf (
|
||||
server,
|
||||
IRC_SERVER_SEND_OUTQ_PRIO_HIGH | IRC_SERVER_SEND_RETURN_LIST,
|
||||
NULL,
|
||||
"PRIVMSG %s :\01ACTION%s%s\01",
|
||||
channel->name,
|
||||
(message && message[0]) ? " " : "",
|
||||
(message && message[0]) ? message : "");
|
||||
if (list_messages)
|
||||
{
|
||||
list_size = weechat_arraylist_size (list_messages);
|
||||
for (i = 0; i < list_size; i++)
|
||||
{
|
||||
irc_command_me_channel_display (
|
||||
server,
|
||||
channel,
|
||||
(const char *)weechat_arraylist_get (list_messages, i));
|
||||
}
|
||||
weechat_arraylist_free (list_messages);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Sends a ctcp action to a channel.
|
||||
*/
|
||||
|
||||
void
|
||||
irc_command_me_channel (struct t_irc_server *server,
|
||||
struct t_irc_channel *channel,
|
||||
const char *arguments)
|
||||
{
|
||||
char **list_arguments;
|
||||
int i, count_arguments;
|
||||
|
||||
list_arguments = weechat_string_split ((arguments) ? arguments : "",
|
||||
"\n", NULL, 0, 0, &count_arguments);
|
||||
if (list_arguments)
|
||||
{
|
||||
for (i = 0; i < count_arguments; i++)
|
||||
{
|
||||
irc_command_me_channel_message (server, channel, list_arguments[i]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
irc_command_me_channel_message (server, channel, "");
|
||||
}
|
||||
|
||||
weechat_string_free_split (list_arguments);
|
||||
}
|
||||
|
||||
/*
|
||||
* Sends a ctcp action to all channels of a server.
|
||||
*/
|
||||
|
||||
void
|
||||
irc_command_me_all_channels (struct t_irc_server *server, const char *arguments)
|
||||
{
|
||||
struct t_irc_channel *ptr_channel;
|
||||
|
||||
for (ptr_channel = server->channels; ptr_channel;
|
||||
ptr_channel = ptr_channel->next_channel)
|
||||
{
|
||||
if (ptr_channel->type == IRC_CHANNEL_TYPE_CHANNEL)
|
||||
irc_command_me_channel (server, ptr_channel, arguments);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Displays away on all channels of all servers.
|
||||
*/
|
||||
@@ -1851,7 +1886,6 @@ IRC_COMMAND_CALLBACK(connect)
|
||||
|
||||
IRC_COMMAND_CALLBACK(ctcp)
|
||||
{
|
||||
struct t_irc_channel *ptr_channel_target;
|
||||
char **targets, *ctcp_type, str_time[512];
|
||||
const char *ctcp_target, *ctcp_args;
|
||||
int num_targets, arg_target, arg_type, arg_args, i;
|
||||
@@ -1931,17 +1965,17 @@ IRC_COMMAND_CALLBACK(ctcp)
|
||||
|
||||
if (ctcp_target)
|
||||
{
|
||||
/* display message only if capability "echo-message" is NOT enabled */
|
||||
/* display only if capability "echo-message" is NOT enabled */
|
||||
if (!weechat_hashtable_has_key (ptr_server->cap_list, "echo-message"))
|
||||
{
|
||||
ptr_channel_target = irc_channel_search (
|
||||
irc_input_user_message_display (
|
||||
ptr_server,
|
||||
(irc_server_prefix_char_statusmsg (ptr_server,
|
||||
ctcp_target[0])
|
||||
&& irc_channel_is_channel (ptr_server, ctcp_target + 1)) ?
|
||||
ctcp_target + 1 : ctcp_target);
|
||||
irc_ctcp_display_send (ptr_server, ptr_channel_target,
|
||||
ctcp_target, NULL, ctcp_type, ctcp_args);
|
||||
ctcp_target,
|
||||
NULL, /* address */
|
||||
"privmsg",
|
||||
ctcp_type,
|
||||
ctcp_args,
|
||||
1); /* decode_colors */
|
||||
}
|
||||
irc_ctcp_send (ptr_server, ctcp_target, ctcp_type, ctcp_args);
|
||||
}
|
||||
@@ -3501,7 +3535,7 @@ IRC_COMMAND_CALLBACK(map)
|
||||
}
|
||||
|
||||
/*
|
||||
* Callback for command "/me": sends a ctcp action to the current channel.
|
||||
* Callback for command "/me": sends a CTCP ACTION to the current channel.
|
||||
*/
|
||||
|
||||
IRC_COMMAND_CALLBACK(me)
|
||||
@@ -3523,7 +3557,7 @@ IRC_COMMAND_CALLBACK(me)
|
||||
return WEECHAT_RC_OK;
|
||||
}
|
||||
|
||||
irc_command_me_channel (ptr_server, ptr_channel,
|
||||
irc_command_me_channel (ptr_server, ptr_channel->name,
|
||||
(argc > 1) ? argv_eol[1] : NULL);
|
||||
|
||||
return WEECHAT_RC_OK;
|
||||
@@ -3648,10 +3682,8 @@ IRC_COMMAND_CALLBACK(motd)
|
||||
|
||||
IRC_COMMAND_CALLBACK(msg)
|
||||
{
|
||||
char **targets, *msg_pwd_hidden, *string;
|
||||
int num_targets, i, j, arg_target, arg_text, is_channel, status_msg;
|
||||
int hide_password;
|
||||
struct t_irc_channel *ptr_channel2;
|
||||
char **targets;
|
||||
int num_targets, i, arg_target, arg_text;
|
||||
|
||||
IRC_BUFFER_GET_SERVER_CHANNEL(buffer);
|
||||
|
||||
@@ -3698,9 +3730,18 @@ IRC_COMMAND_CALLBACK(msg)
|
||||
}
|
||||
else
|
||||
{
|
||||
irc_input_user_message_display (ptr_channel->buffer,
|
||||
0, 0, NULL, 0,
|
||||
argv_eol[arg_text]);
|
||||
/* display only if capability "echo-message" is NOT enabled */
|
||||
if (!weechat_hashtable_has_key (ptr_server->cap_list, "echo-message"))
|
||||
{
|
||||
irc_input_user_message_display (
|
||||
ptr_server,
|
||||
ptr_channel->name,
|
||||
NULL, /* address */
|
||||
"privmsg",
|
||||
NULL, /* ctcp_type */
|
||||
argv_eol[arg_text],
|
||||
1); /* decode_colors */
|
||||
}
|
||||
irc_server_sendf (ptr_server,
|
||||
IRC_SERVER_SEND_OUTQ_PRIO_HIGH, NULL,
|
||||
"PRIVMSG %s :%s",
|
||||
@@ -3709,135 +3750,22 @@ IRC_COMMAND_CALLBACK(msg)
|
||||
}
|
||||
else
|
||||
{
|
||||
is_channel = 0;
|
||||
ptr_channel2 = NULL;
|
||||
status_msg = 0;
|
||||
if (irc_server_prefix_char_statusmsg (ptr_server,
|
||||
targets[i][0])
|
||||
&& irc_channel_is_channel (ptr_server, targets[i] + 1))
|
||||
/* display only if capability "echo-message" is NOT enabled */
|
||||
if (!weechat_hashtable_has_key (ptr_server->cap_list, "echo-message"))
|
||||
{
|
||||
ptr_channel2 = irc_channel_search (ptr_server, targets[i] + 1);
|
||||
is_channel = 1;
|
||||
status_msg = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
ptr_channel2 = irc_channel_search (ptr_server, targets[i]);
|
||||
if (ptr_channel2)
|
||||
is_channel = 1;
|
||||
}
|
||||
if (is_channel)
|
||||
{
|
||||
if (ptr_channel2)
|
||||
{
|
||||
irc_input_user_message_display (
|
||||
ptr_channel2->buffer,
|
||||
0, /* action */
|
||||
0, /* notice */
|
||||
(status_msg) ? targets[i] : NULL,
|
||||
is_channel,
|
||||
argv_eol[arg_text]);
|
||||
}
|
||||
irc_server_sendf (ptr_server,
|
||||
IRC_SERVER_SEND_OUTQ_PRIO_HIGH, NULL,
|
||||
"PRIVMSG %s :%s",
|
||||
targets[i], argv_eol[arg_text]);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* check if the password must be hidden for this nick */
|
||||
hide_password = 0;
|
||||
if (irc_config_nicks_hide_password)
|
||||
{
|
||||
for (j = 0; j < irc_config_num_nicks_hide_password; j++)
|
||||
{
|
||||
if (weechat_strcasecmp (irc_config_nicks_hide_password[j],
|
||||
targets[i]) == 0)
|
||||
{
|
||||
hide_password = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (hide_password)
|
||||
{
|
||||
/* hide password in message displayed using modifier */
|
||||
msg_pwd_hidden = weechat_hook_modifier_exec (
|
||||
"irc_message_auth",
|
||||
ptr_server->name,
|
||||
argv_eol[arg_text]);
|
||||
string = irc_color_decode (
|
||||
(msg_pwd_hidden) ? msg_pwd_hidden : argv_eol[arg_text],
|
||||
weechat_config_boolean (irc_config_network_colors_send));
|
||||
weechat_printf (
|
||||
ptr_server->buffer,
|
||||
"%sMSG%s(%s%s%s)%s: %s",
|
||||
weechat_prefix ("network"),
|
||||
IRC_COLOR_CHAT_DELIMITERS,
|
||||
irc_nick_color_for_msg (ptr_server, 0, NULL,
|
||||
targets[i]),
|
||||
targets[i],
|
||||
IRC_COLOR_CHAT_DELIMITERS,
|
||||
IRC_COLOR_RESET,
|
||||
(string) ?
|
||||
string : ((msg_pwd_hidden) ?
|
||||
msg_pwd_hidden : argv_eol[arg_text]));
|
||||
if (string)
|
||||
free (string);
|
||||
if (msg_pwd_hidden)
|
||||
free (msg_pwd_hidden);
|
||||
}
|
||||
else
|
||||
{
|
||||
ptr_channel2 = irc_channel_search (ptr_server,
|
||||
targets[i]);
|
||||
if (ptr_channel2)
|
||||
{
|
||||
irc_input_user_message_display (ptr_channel2->buffer,
|
||||
0, 0, NULL, 0,
|
||||
argv_eol[arg_text]);
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* display message only if capability "echo-message"
|
||||
* is NOT enabled
|
||||
*/
|
||||
if (!weechat_hashtable_has_key (ptr_server->cap_list,
|
||||
"echo-message"))
|
||||
{
|
||||
string = irc_color_decode (
|
||||
argv_eol[arg_text],
|
||||
weechat_config_boolean (
|
||||
irc_config_network_colors_send));
|
||||
weechat_printf_date_tags (
|
||||
ptr_server->buffer,
|
||||
0,
|
||||
irc_protocol_tags (
|
||||
ptr_server,
|
||||
"privmsg",
|
||||
NULL,
|
||||
"self_msg,notify_none,no_highlight",
|
||||
ptr_server->nick, NULL),
|
||||
"%sMSG%s(%s%s%s)%s: %s",
|
||||
weechat_prefix ("network"),
|
||||
IRC_COLOR_CHAT_DELIMITERS,
|
||||
irc_nick_color_for_msg (
|
||||
ptr_server, 0, NULL, targets[i]),
|
||||
targets[i],
|
||||
IRC_COLOR_CHAT_DELIMITERS,
|
||||
IRC_COLOR_RESET,
|
||||
(string) ? string : argv_eol[arg_text]);
|
||||
if (string)
|
||||
free (string);
|
||||
}
|
||||
}
|
||||
}
|
||||
irc_server_sendf (ptr_server,
|
||||
IRC_SERVER_SEND_OUTQ_PRIO_HIGH, NULL,
|
||||
"PRIVMSG %s :%s",
|
||||
targets[i], argv_eol[arg_text]);
|
||||
irc_input_user_message_display (
|
||||
ptr_server,
|
||||
targets[i],
|
||||
NULL, /* address */
|
||||
"privmsg",
|
||||
NULL, /* ctcp_type */
|
||||
argv_eol[arg_text],
|
||||
1); /* decode_colors */
|
||||
}
|
||||
irc_server_sendf (ptr_server,
|
||||
IRC_SERVER_SEND_OUTQ_PRIO_HIGH, NULL,
|
||||
"PRIVMSG %s :%s",
|
||||
targets[i], argv_eol[arg_text]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3943,8 +3871,7 @@ IRC_COMMAND_CALLBACK(nick)
|
||||
IRC_COMMAND_CALLBACK(notice)
|
||||
{
|
||||
const char *ptr_message;
|
||||
int i, arg_target, arg_text, is_channel, list_size;
|
||||
struct t_irc_channel *ptr_channel;
|
||||
int i, arg_target, arg_text, list_size;
|
||||
struct t_arraylist *list_messages;
|
||||
|
||||
IRC_BUFFER_GET_SERVER(buffer);
|
||||
@@ -3965,19 +3892,7 @@ IRC_COMMAND_CALLBACK(notice)
|
||||
}
|
||||
|
||||
IRC_COMMAND_CHECK_SERVER("notice", 1, 1);
|
||||
is_channel = 0;
|
||||
if (irc_server_prefix_char_statusmsg (ptr_server, argv[arg_target][0])
|
||||
&& irc_channel_is_channel (ptr_server, argv[arg_target] + 1))
|
||||
{
|
||||
ptr_channel = irc_channel_search (ptr_server, argv[arg_target] + 1);
|
||||
is_channel = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
ptr_channel = irc_channel_search (ptr_server, argv[arg_target]);
|
||||
if (ptr_channel)
|
||||
is_channel = 1;
|
||||
}
|
||||
|
||||
list_messages = irc_server_sendf (
|
||||
ptr_server,
|
||||
IRC_SERVER_SEND_OUTQ_PRIO_HIGH | IRC_SERVER_SEND_RETURN_LIST,
|
||||
@@ -3986,19 +3901,22 @@ IRC_COMMAND_CALLBACK(notice)
|
||||
argv[arg_target], argv_eol[arg_text]);
|
||||
if (list_messages)
|
||||
{
|
||||
list_size = weechat_arraylist_size (list_messages);
|
||||
for (i = 0; i < list_size; i++)
|
||||
/* display only if capability "echo-message" is NOT enabled */
|
||||
if (!weechat_hashtable_has_key (ptr_server->cap_list, "echo-message"))
|
||||
{
|
||||
ptr_message = (const char *)weechat_arraylist_get (list_messages, i);
|
||||
irc_input_user_message_display (
|
||||
irc_msgbuffer_get_target_buffer (
|
||||
ptr_server, argv[arg_target], "notice", NULL,
|
||||
(ptr_channel) ? ptr_channel->buffer : NULL),
|
||||
0, /* action */
|
||||
1, /* notice */
|
||||
argv[arg_target],
|
||||
is_channel,
|
||||
ptr_message);
|
||||
list_size = weechat_arraylist_size (list_messages);
|
||||
for (i = 0; i < list_size; i++)
|
||||
{
|
||||
ptr_message = (const char *)weechat_arraylist_get (list_messages, i);
|
||||
irc_input_user_message_display (
|
||||
ptr_server,
|
||||
argv[arg_target],
|
||||
NULL, /* address */
|
||||
"notice",
|
||||
NULL, /* ctcp_type */
|
||||
ptr_message,
|
||||
1); /* decode_colors */
|
||||
}
|
||||
}
|
||||
weechat_arraylist_free (list_messages);
|
||||
}
|
||||
@@ -4516,9 +4434,18 @@ IRC_COMMAND_CALLBACK(query)
|
||||
/* display text if given */
|
||||
if (argv_eol[arg_text])
|
||||
{
|
||||
irc_input_user_message_display (ptr_channel->buffer,
|
||||
0, 0, NULL, 0,
|
||||
argv_eol[arg_text]);
|
||||
/* display only if capability "echo-message" is NOT enabled */
|
||||
if (!weechat_hashtable_has_key (ptr_server->cap_list, "echo-message"))
|
||||
{
|
||||
irc_input_user_message_display (
|
||||
ptr_server,
|
||||
ptr_channel->name,
|
||||
NULL, /* address */
|
||||
"privmsg",
|
||||
NULL, /* ctcp_type */
|
||||
argv_eol[arg_text],
|
||||
1); /* decode_colors */
|
||||
}
|
||||
irc_server_sendf (ptr_server, IRC_SERVER_SEND_OUTQ_PRIO_HIGH,
|
||||
NULL,
|
||||
"PRIVMSG %s :%s",
|
||||
@@ -6761,6 +6688,16 @@ IRC_COMMAND_CALLBACK(whowas)
|
||||
void
|
||||
irc_command_init ()
|
||||
{
|
||||
weechat_hook_command (
|
||||
"action",
|
||||
N_("send a CTCP action to a nick or channel"),
|
||||
N_("[-server <server>] <target>[,<target>...] <text>"),
|
||||
N_("server: send to this server (internal name)\n"
|
||||
"target: nick or channel (may be mask, '*' = current channel)\n"
|
||||
" text: text to send"),
|
||||
"-server %(irc_servers) %(nicks)|*"
|
||||
" || %(nicks)|*",
|
||||
&irc_command_action, NULL, NULL);
|
||||
weechat_hook_command (
|
||||
"admin",
|
||||
N_("find information about the administrator of the server"),
|
||||
|
||||
Reference in New Issue
Block a user