Make metadata use UIDs for s2s communication, and fix up propegation of channel metadata.

This commit is contained in:
B.Greenham 2010-03-08 18:09:10 -05:00
parent ad89735d9e
commit 0fbe4a384c
4 changed files with 6 additions and 8 deletions

View File

@ -50,7 +50,7 @@ me_metadata(struct Client *client_p, struct Client *source_p, int parc, const ch
{ {
struct Client *target_p; struct Client *target_p;
if((target_p = find_client(parv[2])) == NULL) if((target_p = find_id(parv[2])) == NULL)
return; return;
if(!target_p->user) if(!target_p->user)

View File

@ -1957,7 +1957,7 @@ user_metadata_add(struct Client *target, const char *name, const char *value, in
if(propegate) if(propegate)
sendto_match_servs(&me, "*", CAP_ENCAP, NOCAPS, "ENCAP * METADATA ADD %s %s :%s", sendto_match_servs(&me, "*", CAP_ENCAP, NOCAPS, "ENCAP * METADATA ADD %s %s :%s",
target->name, name, value); target->id, name, value);
return md; return md;
} }
@ -1985,7 +1985,7 @@ user_metadata_delete(struct Client *target, const char *name, int propegate)
if(propegate) if(propegate)
sendto_match_servs(&me, "*", CAP_ENCAP, NOCAPS, "ENCAP * METADATA DELETE %s %s", sendto_match_servs(&me, "*", CAP_ENCAP, NOCAPS, "ENCAP * METADATA DELETE %s %s",
target->name, name); target->id, name);
} }
/* /*

View File

@ -526,7 +526,7 @@ burst_TS6(struct Client *client_p)
DICTIONARY_FOREACH(md, &iter, target_p->user->metadata) DICTIONARY_FOREACH(md, &iter, target_p->user->metadata)
{ {
sendto_one(client_p, ":%s ENCAP * METADATA ADD %s %s :%s", 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)) 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 */ /* don't bother bursting +J metadata */
if(!(md->name[0] == 'K')) if(!(md->name[0] == 'K'))
sendto_one(&me, ":%s ENCAP * METADATA ADD %s %s :%s", 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), chptr->chname, md->name, md->value);
} }
if(rb_dlink_list_length(&chptr->banlist) > 0) if(rb_dlink_list_length(&chptr->banlist) > 0)

View File

@ -1031,8 +1031,6 @@ user_mode(struct Client *client_p, struct Client *source_p, int parc, const char
Count.oper--; 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, "OPERSTRING", 1);
user_metadata_delete(source_p, "SWHOIS", 1); user_metadata_delete(source_p, "SWHOIS", 1);