summaryrefslogtreecommitdiff
path: root/src/plugins/irc/irc-protocol.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/irc/irc-protocol.c')
-rw-r--r--src/plugins/irc/irc-protocol.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/plugins/irc/irc-protocol.c b/src/plugins/irc/irc-protocol.c
index 239e3dbca..b0e8427fb 100644
--- a/src/plugins/irc/irc-protocol.c
+++ b/src/plugins/irc/irc-protocol.c
@@ -124,11 +124,15 @@ irc_protocol_tags_add_cb (void *data,
const void *key,
const void *value)
{
- char **str_tags, *str_temp, *str_temp2;
+ const char *ptr_key, *ptr_value;
+ char **str_tags, *str_temp;
/* make C compiler happy */
(void) hashtable;
+ ptr_key = (const char *)key;
+ ptr_value = (const char *)value;
+
str_tags = (char **)data;
if (*str_tags[0])
@@ -137,18 +141,17 @@ irc_protocol_tags_add_cb (void *data,
weechat_string_dyn_concat (str_tags, "irc_tag_", -1);
/* key */
- str_temp = weechat_string_replace ((const char *)key, ",", ";");
- str_temp2 = weechat_string_replace (str_temp, "_", "-");
- if (str_temp2)
- weechat_string_dyn_concat (str_tags, str_temp2, -1);
+ str_temp = weechat_string_replace (ptr_key, ",", ";");
+ weechat_string_dyn_concat (str_tags, str_temp, -1);
if (str_temp)
free (str_temp);
- if (str_temp2)
- free (str_temp2);
- weechat_string_dyn_concat (str_tags, "_", -1);
+
+ /* separator between key and value */
+ if (ptr_value)
+ weechat_string_dyn_concat (str_tags, "=", -1);
/* value */
- str_temp = weechat_string_replace ((const char *)value, ",", ";");
+ str_temp = weechat_string_replace (ptr_value, ",", ";");
weechat_string_dyn_concat (str_tags, str_temp, -1);
if (str_temp)
free (str_temp);