modules/core/m_metadata: Re-add support for the old metadata verbs and document the old metadata system.
This commit is contained in:
parent
5810ebb18f
commit
8bff90d496
|
@ -52,3 +52,17 @@ servers and check. Bots or pseudoservices may also uses these lines to perform
|
||||||
additional actions (such as `AKILL`s or logging to channels) as needed by the
|
additional actions (such as `AKILL`s or logging to channels) as needed by the
|
||||||
bot author.
|
bot author.
|
||||||
|
|
||||||
|
#### METADATA
|
||||||
|
|
||||||
|
The old ShadowIRCD implementation of METADATA used `ADD` and `DELETE` verbs for
|
||||||
|
adding and deleting metadata to channels and clients. This, in practice looks
|
||||||
|
something like:
|
||||||
|
|
||||||
|
<<< :45X ENCAP * METADATA ADD 1NRAAAABR OPERSTRING :is an IRC Administrator
|
||||||
|
<<< :45X ENCAP * METADATA DELETE 1NRAAAABR OPERSTRING
|
||||||
|
|
||||||
|
Functionality is identical to the new `SET` and `CLEAR` verbs, but this deviates
|
||||||
|
from the spec by being **only** a server to server command. Support for client
|
||||||
|
to server and server to client metadata setting/getting will come in a future
|
||||||
|
version of elemental-ircd.
|
||||||
|
|
||||||
|
|
|
@ -45,6 +45,13 @@ me_metadata(struct Client *client_p, struct Client *source_p, int parc, const ch
|
||||||
if((chptr = find_channel(parv[2])) == NULL)
|
if((chptr = find_channel(parv[2])) == NULL)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
//XXX need to support the old, nonstandard verbs for compatability reasons
|
||||||
|
if(!strcmp(parv[1], "ADD") && parv[4] != NULL)
|
||||||
|
channel_metadata_add(chptr, parv[3], parv[4], 0);
|
||||||
|
if(!strcmp(parv[1], "DELETE") && parv[3] != NULL)
|
||||||
|
channel_metadata_delete(chptr, parv[3], 0);
|
||||||
|
|
||||||
|
//Now moving on to the standard ones
|
||||||
if(!strcmp(parv[1], "SET") && parv[4] != NULL)
|
if(!strcmp(parv[1], "SET") && parv[4] != NULL)
|
||||||
channel_metadata_add(chptr, parv[3], parv[4], 0);
|
channel_metadata_add(chptr, parv[3], parv[4], 0);
|
||||||
if(!strcmp(parv[1], "CLEAR") && parv[3] != NULL)
|
if(!strcmp(parv[1], "CLEAR") && parv[3] != NULL)
|
||||||
|
@ -61,6 +68,13 @@ me_metadata(struct Client *client_p, struct Client *source_p, int parc, const ch
|
||||||
if(!target_p->user)
|
if(!target_p->user)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
//XXX need to support the old, nonstandard verbs for compatability reasons
|
||||||
|
if(!strcmp(parv[1], "ADD") && parv[4] != NULL)
|
||||||
|
user_metadata_add(target_p, parv[3], parv[4], 0);
|
||||||
|
if(!strcmp(parv[1], "DELETE") && parv[3] != NULL)
|
||||||
|
user_metadata_delete(target_p, parv[3], 0);
|
||||||
|
|
||||||
|
//Now moving on to the standard ones
|
||||||
if(!strcmp(parv[1], "SET") && parv[4] != NULL)
|
if(!strcmp(parv[1], "SET") && parv[4] != NULL)
|
||||||
user_metadata_add(target_p, parv[3], parv[4], 0);
|
user_metadata_add(target_p, parv[3], parv[4], 0);
|
||||||
if(!strcmp(parv[1], "CLEAR") && parv[3] != NULL)
|
if(!strcmp(parv[1], "CLEAR") && parv[3] != NULL)
|
||||||
|
|
Loading…
Reference in New Issue