mirror of
https://github.com/matrix-construct/construct
synced 2024-11-26 08:42:34 +01:00
presence: Make set_metadata() erase any old metadata for an entry.
This commit is contained in:
parent
75ea650c3c
commit
df2688426d
1 changed files with 2 additions and 1 deletions
|
@ -1751,13 +1751,14 @@ set_metadata(struct Client *client_p, const char *key, const char *value)
|
|||
{
|
||||
struct MetadataEntry *md;
|
||||
|
||||
delete_metadata(client_p, key);
|
||||
if(client_p->user != NULL)
|
||||
{
|
||||
md = rb_bh_alloc(metadata_heap);
|
||||
rb_strlcpy(md->key, key, NICKLEN);
|
||||
rb_strlcpy(md->value, value, TOPICLEN);
|
||||
|
||||
irc_dictionary_add(client_p->user->metadata, key, md);
|
||||
irc_dictionary_add(client_p->user->metadata, md->key, md);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue