Do not send two 792 numerics when changing a metadata from one non-empty value to another.
This commit is contained in:
parent
331c548d9d
commit
383eac2e64
1 changed files with 12 additions and 5 deletions
13
src/client.c
13
src/client.c
|
@ -1747,15 +1747,22 @@ set_metadata(struct Client *client_p, const char *key, const char *value)
|
||||||
{
|
{
|
||||||
struct MetadataEntry *md;
|
struct MetadataEntry *md;
|
||||||
|
|
||||||
delete_metadata(client_p, key);
|
|
||||||
if(client_p->user != NULL)
|
if(client_p->user != NULL)
|
||||||
|
{
|
||||||
|
md = irc_dictionary_retrieve(client_p->user->metadata, key);
|
||||||
|
if (md == NULL)
|
||||||
{
|
{
|
||||||
md = rb_bh_alloc(metadata_heap);
|
md = rb_bh_alloc(metadata_heap);
|
||||||
rb_strlcpy(md->key, key, NICKLEN);
|
rb_strlcpy(md->key, key, NICKLEN);
|
||||||
rb_strlcpy(md->value, value, TOPICLEN);
|
|
||||||
|
|
||||||
irc_dictionary_add(client_p->user->metadata, md->key, md);
|
irc_dictionary_add(client_p->user->metadata, md->key, md);
|
||||||
}
|
}
|
||||||
|
else if (!strcmp(md->key, key) && !strcmp(md->value, value))
|
||||||
|
return;
|
||||||
|
else
|
||||||
|
rb_strlcpy(md->key, key, NICKLEN);
|
||||||
|
|
||||||
|
rb_strlcpy(md->value, value, TOPICLEN);
|
||||||
|
}
|
||||||
|
|
||||||
sendto_common_channels_local_with_capability(client_p, CLICAP_PRESENCE, form_str(RPL_METADATACHG), me.name, client_p->name, key, value);
|
sendto_common_channels_local_with_capability(client_p, CLICAP_PRESENCE, form_str(RPL_METADATACHG), me.name, client_p->name, key, value);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue