1
- /* Copyright (C) All Rights Reserved
2
- ** Written by k4be
3
- ** Website: https://github.com/pirc-pl/unrealircd-modules/
1
+ /* Copyright (C) 2020-2021 k4be
2
+ ** Copyright (C) 2023 Valentin Lorentz
4
3
** License: GPLv3 https://www.gnu.org/licenses/gpl-3.0.html
5
4
*/
6
5
7
6
/*** <<<MODULE MANAGER START>>>
8
7
module
9
8
{
10
- documentation "https://github.com/pirc-pl/unrealircd-modules/blob/master/README.md#metadata";
11
- troubleshooting "In case of problems, contact k4be on irc.pirc.pl .";
9
+ documentation "Implements the draft IRCv3 metadata-2 specification https://github.com/ircv3/ircv3-specifications/pull/501"
10
+ troubleshooting "In case of problems, contact val on irc.unrealircd.org .";
12
11
min-unrealircd-version "6.*";
13
12
post-install-text {
14
13
"The module is installed. Now all you need to do is add a loadmodule line:";
15
- "loadmodule \"third/metadata \";";
14
+ "loadmodule \"third/metadata2 \";";
16
15
"And /REHASH the IRCd.";
17
16
"The module may be additionaly configured to change the defaults.";
18
17
"See documentation for help.";
69
68
#define MODE_SET 0
70
69
#define MODE_GET 1
71
70
72
- #define MYCONF "metadata "
71
+ #define MYCONF "metadata2 "
73
72
74
73
#define CHECKPARAMSCNT_OR_DIE (count , return ) \
75
74
{ \
@@ -198,10 +197,10 @@ struct metadata_settings_s {
198
197
} metadata_settings ;
199
198
200
199
ModuleHeader MOD_HEADER = {
201
- "third/metadata " ,
200
+ "third/metadata2 " ,
202
201
"6.0" ,
203
- "draft/metadata and draft/metadata-notify-2 cap" ,
204
- "k4be" ,
202
+ "draft/metadata2 and draft/metadata-notify-2 cap" ,
203
+ "k4be & val " ,
205
204
"unrealircd-6"
206
205
};
207
206
@@ -369,7 +368,7 @@ MOD_INIT() {
369
368
MARK_AS_GLOBAL_MODULE (modinfo );
370
369
371
370
memset (& cap , 0 , sizeof (cap ));
372
- cap .name = "draft/metadata" ;
371
+ cap .name = "draft/metadata-2 " ;
373
372
cap .parameter = metadata_cap_param ;
374
373
c = ClientCapabilityAdd (modinfo -> handle , & cap , & CAP_METADATA );
375
374
@@ -501,17 +500,17 @@ int metadata_notify_or_queue(Client *client, const char *who, const char *key, c
501
500
int trylater = 0 ;
502
501
if (!who )
503
502
{
504
- unreal_log (ULOG_DEBUG , "metadata " , "METADATA_DEBUG" , changer , "metadata_notify_or_queue called with null who!" );
503
+ unreal_log (ULOG_DEBUG , "metadata2 " , "METADATA_DEBUG" , changer , "metadata_notify_or_queue called with null who!" );
505
504
return 0 ;
506
505
}
507
506
if (!key )
508
507
{
509
- unreal_log (ULOG_DEBUG , "metadata " , "METADATA_DEBUG" , changer , "metadata_notify_or_queue called with null key!" );
508
+ unreal_log (ULOG_DEBUG , "metadata2 " , "METADATA_DEBUG" , changer , "metadata_notify_or_queue called with null key!" );
510
509
return 0 ;
511
510
}
512
511
if (!client )
513
512
{
514
- unreal_log (ULOG_DEBUG , "metadata " , "METADATA_DEBUG" , changer , "metadata_notify_or_queue called with null client!" );
513
+ unreal_log (ULOG_DEBUG , "metadata2 " , "METADATA_DEBUG" , changer , "metadata_notify_or_queue called with null client!" );
515
514
return 0 ;
516
515
}
517
516
@@ -541,17 +540,17 @@ void metadata_send_change(Client *client, const char *who, const char *key, cons
541
540
char * sender = NULL ;
542
541
if (!key )
543
542
{
544
- unreal_log (ULOG_DEBUG , "metadata " , "METADATA_DEBUG" , changer , "metadata_send_change called with null key!" );
543
+ unreal_log (ULOG_DEBUG , "metadata2 " , "METADATA_DEBUG" , changer , "metadata_send_change called with null key!" );
545
544
return ;
546
545
}
547
546
if (!who )
548
547
{
549
- unreal_log (ULOG_DEBUG , "metadata " , "METADATA_DEBUG" , changer , "metadata_send_change called with null who!" );
548
+ unreal_log (ULOG_DEBUG , "metadata2 " , "METADATA_DEBUG" , changer , "metadata_send_change called with null who!" );
550
549
return ;
551
550
}
552
551
if (!client )
553
552
{
554
- unreal_log (ULOG_DEBUG , "metadata " , "METADATA_DEBUG" , changer , "metadata_send_change called with null client!" );
553
+ unreal_log (ULOG_DEBUG , "metadata2 " , "METADATA_DEBUG" , changer , "metadata_send_change called with null client!" );
555
554
return ;
556
555
}
557
556
if (changer )
@@ -1211,7 +1210,7 @@ CMD_FUNC(cmd_metadata_remote)
1211
1210
value = NULL ;
1212
1211
} else
1213
1212
{
1214
- unreal_log (ULOG_DEBUG , "metadata " , "METADATA_DEBUG" , client , "METADATA S2S: not enough args from $sender" ,
1213
+ unreal_log (ULOG_DEBUG , "metadata2 " , "METADATA_DEBUG" , client , "METADATA S2S: not enough args from $sender" ,
1215
1214
log_data_string ("sender" , client -> name ));
1216
1215
return ;
1217
1216
}
@@ -1226,7 +1225,7 @@ CMD_FUNC(cmd_metadata_remote)
1226
1225
1227
1226
if (!* target || !strcmp (target , "*" ) || !metadata_key_valid (key ))
1228
1227
{
1229
- unreal_log (ULOG_DEBUG , "metadata " , "METADATA_DEBUG" , client , "METADATA S2S: bad metadata target $target or key $key from $sender" ,
1228
+ unreal_log (ULOG_DEBUG , "metadata2 " , "METADATA_DEBUG" , client , "METADATA S2S: bad metadata target $target or key $key from $sender" ,
1230
1229
log_data_string ("target" , target ),
1231
1230
log_data_string ("key" , key ),
1232
1231
log_data_string ("sender" , client -> name ));
0 commit comments