From df2688426defd6d868d5384fe8fe672c0390303c Mon Sep 17 00:00:00 2001 From: William Pitcock Date: Tue, 2 Jun 2009 01:53:05 -0500 Subject: [PATCH] presence: Make set_metadata() erase any old metadata for an entry. --- src/client.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/client.c b/src/client.c index eb3110d6..542729ff 100644 --- a/src/client.c +++ b/src/client.c @@ -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); } }