summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2024-05-16 07:16:11 +0200
committerSébastien Helleu <flashcode@flashtux.org>2024-05-16 07:16:11 +0200
commit761d2dec126674f6d00f99f63d85a5899924cacf (patch)
treeed0d36140f7c909d06406f8788a108af6f554037 /src
parent6db01bee34f5cabdc728ba2df64f48657dadd9fd (diff)
downloadweechat-761d2dec126674f6d00f99f63d85a5899924cacf.zip
core: send signal "buffer_localvar_{added|changed}" only if local variable has been added or changed
Diffstat (limited to 'src')
-rw-r--r--src/gui/gui-buffer.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gui/gui-buffer.c b/src/gui/gui-buffer.c
index d5fa56a9e..20e50c87a 100644
--- a/src/gui/gui-buffer.c
+++ b/src/gui/gui-buffer.c
@@ -266,7 +266,11 @@ gui_buffer_local_var_add (struct t_gui_buffer *buffer, const char *name,
return;
ptr_value = hashtable_get (buffer->local_variables, name);
+ if (string_strcmp (ptr_value, value) == 0)
+ return;
+
hashtable_set (buffer->local_variables, name, value);
+
(void) gui_buffer_send_signal (
buffer,
(ptr_value) ? "buffer_localvar_changed" : "buffer_localvar_added",