summaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2023-08-13 16:38:29 +0200
committerSébastien Helleu <flashcode@flashtux.org>2023-08-13 16:38:29 +0200
commit46cea77585720f38d197f8bb4f3159c0b3d63ec8 (patch)
tree46f34040922a2a61d0685f8834723e44a24885c7 /src/plugins
parent4290876e646df7c73424be4a44d6494f0c184d81 (diff)
downloadweechat-46cea77585720f38d197f8bb4f3159c0b3d63ec8.zip
relay: synchronize nick modes with IRC client upon connection (closes #1984)
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/relay/irc/relay-irc.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/src/plugins/relay/irc/relay-irc.c b/src/plugins/relay/irc/relay-irc.c
index afe44ccc5..eaf37f407 100644
--- a/src/plugins/relay/irc/relay-irc.c
+++ b/src/plugins/relay/irc/relay-irc.c
@@ -1638,11 +1638,11 @@ relay_irc_recv (struct t_relay_client *client, const char *data)
struct t_hashtable *hash_parsed, *hash_redirect;
struct t_infolist *infolist_server;
const char *irc_command, *str_num_params, *isupport, *pos_password;
- const char *ptr_data;
+ const char *ptr_data, *ptr_nick_modes;
char str_time[128], str_signal[128], str_server_channel[256], *nick;
char str_param[128], *str_args, *version, str_command[128], **params;
char *pos, *password, *irc_is_channel, *info, *error, *str_cmd_lower;
- char modifier_data[128], *new_data, *ctcp_type, *ctcp_params;
+ char modifier_data[128], *new_data, *ctcp_type, *ctcp_params, *nick_modes;
long num_params;
int i, redirect_msg;
@@ -1875,12 +1875,17 @@ relay_irc_recv (struct t_relay_client *client, const char *data)
version);
if (version)
free (version);
+ nick_modes = NULL;
infolist_server = weechat_infolist_get ("irc_server", NULL,
client->protocol_args);
if (infolist_server)
{
if (weechat_infolist_next (infolist_server))
{
+ ptr_nick_modes = weechat_infolist_string (infolist_server,
+ "nick_modes");
+ if (ptr_nick_modes)
+ nick_modes = strdup (ptr_nick_modes);
isupport = weechat_infolist_string (infolist_server,
"isupport");
if (isupport && isupport[0])
@@ -1916,6 +1921,18 @@ relay_irc_recv (struct t_relay_client *client, const char *data)
RELAY_IRC_DATA(client, address),
RELAY_IRC_DATA(client, nick));
+ /* send nick modes */
+ if (nick_modes && nick_modes[0])
+ {
+ relay_irc_sendf (client,
+ ":%s MODE %s :+%s",
+ RELAY_IRC_DATA(client, address),
+ RELAY_IRC_DATA(client, nick),
+ nick_modes);
+ }
+ if (nick_modes)
+ free (nick_modes);
+
/* hook signals */
relay_irc_hook_signals (client);