From 0fbe4a384cda0440340ee1de46c980b343b53362 Mon Sep 17 00:00:00 2001 From: "B.Greenham" Date: Mon, 8 Mar 2010 18:09:10 -0500 Subject: [PATCH] Make metadata use UIDs for s2s communication, and fix up propegation of channel metadata. --- modules/core/m_metadata.c | 2 +- src/client.c | 4 ++-- src/s_serv.c | 6 +++--- src/s_user.c | 2 -- 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/modules/core/m_metadata.c b/modules/core/m_metadata.c index dc85dfb..ac29da6 100644 --- a/modules/core/m_metadata.c +++ b/modules/core/m_metadata.c @@ -50,7 +50,7 @@ me_metadata(struct Client *client_p, struct Client *source_p, int parc, const ch { struct Client *target_p; - if((target_p = find_client(parv[2])) == NULL) + if((target_p = find_id(parv[2])) == NULL) return; if(!target_p->user) diff --git a/src/client.c b/src/client.c index b76caf4..1cc32b4 100644 --- a/src/client.c +++ b/src/client.c @@ -1957,7 +1957,7 @@ user_metadata_add(struct Client *target, const char *name, const char *value, in if(propegate) sendto_match_servs(&me, "*", CAP_ENCAP, NOCAPS, "ENCAP * METADATA ADD %s %s :%s", - target->name, name, value); + target->id, name, value); return md; } @@ -1985,7 +1985,7 @@ user_metadata_delete(struct Client *target, const char *name, int propegate) if(propegate) sendto_match_servs(&me, "*", CAP_ENCAP, NOCAPS, "ENCAP * METADATA DELETE %s %s", - target->name, name); + target->id, name); } /* diff --git a/src/s_serv.c b/src/s_serv.c index 94b26bc..315e18a 100644 --- a/src/s_serv.c +++ b/src/s_serv.c @@ -526,7 +526,7 @@ burst_TS6(struct Client *client_p) DICTIONARY_FOREACH(md, &iter, target_p->user->metadata) { sendto_one(client_p, ":%s ENCAP * METADATA ADD %s %s :%s", - use_id(target_p), use_id(target_p), md->name, md->value); + use_id(&me), use_id(target_p), md->name, md->value); } if(ConfigFileEntry.burst_away && !EmptyString(target_p->user->away)) @@ -591,8 +591,8 @@ burst_TS6(struct Client *client_p) { /* don't bother bursting +J metadata */ if(!(md->name[0] == 'K')) - sendto_one(&me, ":%s ENCAP * METADATA ADD %s %s :%s", - use_id(target_p), use_id(target_p), md->name, md->value); + sendto_one(client_p, ":%s ENCAP * METADATA ADD %s %s :%s", + use_id(&me), chptr->chname, md->name, md->value); } if(rb_dlink_list_length(&chptr->banlist) > 0) diff --git a/src/s_user.c b/src/s_user.c index ae3f877..c315565 100644 --- a/src/s_user.c +++ b/src/s_user.c @@ -1031,8 +1031,6 @@ user_mode(struct Client *client_p, struct Client *source_p, int parc, const char Count.oper--; - /* Do we need to propegate these? I'm not 100% sure - * so we should test it when we have a testnet */ user_metadata_delete(source_p, "OPERSTRING", 1); user_metadata_delete(source_p, "SWHOIS", 1);