Commits

Anonymous committed fcb2944

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

Comments (0)

Files changed (4)

modules/core/m_metadata.c

 	{
 		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)
 	
 	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;
 }
 
 	if(propegate)
 		sendto_match_servs(&me, "*", CAP_ENCAP, NOCAPS, "ENCAP * METADATA DELETE %s %s",
-				target->name, name);
+				target->id, name);
 }
 
 /*
 		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))
 		{
 			/* 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)
 
 				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);