Skip to content

Commit 6b901dd

Browse files
committed
metadata2: Update metadata (hah) and cap name
1 parent e3b931e commit 6b901dd

File tree

1 file changed

+18
-19
lines changed

1 file changed

+18
-19
lines changed

files/metadata2.c

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
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
43
** License: GPLv3 https://www.gnu.org/licenses/gpl-3.0.html
54
*/
65

76
/*** <<<MODULE MANAGER START>>>
87
module
98
{
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.";
1211
min-unrealircd-version "6.*";
1312
post-install-text {
1413
"The module is installed. Now all you need to do is add a loadmodule line:";
15-
"loadmodule \"third/metadata\";";
14+
"loadmodule \"third/metadata2\";";
1615
"And /REHASH the IRCd.";
1716
"The module may be additionaly configured to change the defaults.";
1817
"See documentation for help.";
@@ -69,7 +68,7 @@ module
6968
#define MODE_SET 0
7069
#define MODE_GET 1
7170

72-
#define MYCONF "metadata"
71+
#define MYCONF "metadata2"
7372

7473
#define CHECKPARAMSCNT_OR_DIE(count, return) \
7574
{ \
@@ -198,10 +197,10 @@ struct metadata_settings_s {
198197
} metadata_settings;
199198

200199
ModuleHeader MOD_HEADER = {
201-
"third/metadata",
200+
"third/metadata2",
202201
"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",
205204
"unrealircd-6"
206205
};
207206

@@ -369,7 +368,7 @@ MOD_INIT() {
369368
MARK_AS_GLOBAL_MODULE(modinfo);
370369

371370
memset(&cap, 0, sizeof(cap));
372-
cap.name = "draft/metadata";
371+
cap.name = "draft/metadata-2";
373372
cap.parameter = metadata_cap_param;
374373
c = ClientCapabilityAdd(modinfo->handle, &cap, &CAP_METADATA);
375374

@@ -501,17 +500,17 @@ int metadata_notify_or_queue(Client *client, const char *who, const char *key, c
501500
int trylater = 0;
502501
if (!who)
503502
{
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!");
505504
return 0;
506505
}
507506
if (!key)
508507
{
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!");
510509
return 0;
511510
}
512511
if (!client)
513512
{
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!");
515514
return 0;
516515
}
517516

@@ -541,17 +540,17 @@ void metadata_send_change(Client *client, const char *who, const char *key, cons
541540
char *sender = NULL;
542541
if (!key)
543542
{
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!");
545544
return;
546545
}
547546
if (!who)
548547
{
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!");
550549
return;
551550
}
552551
if (!client)
553552
{
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!");
555554
return;
556555
}
557556
if (changer)
@@ -1211,7 +1210,7 @@ CMD_FUNC(cmd_metadata_remote)
12111210
value = NULL;
12121211
} else
12131212
{
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",
12151214
log_data_string("sender", client->name));
12161215
return;
12171216
}
@@ -1226,7 +1225,7 @@ CMD_FUNC(cmd_metadata_remote)
12261225

12271226
if (!*target || !strcmp(target, "*") || !metadata_key_valid(key))
12281227
{
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",
12301229
log_data_string("target", target),
12311230
log_data_string("key", key),
12321231
log_data_string("sender", client->name));

0 commit comments

Comments
 (0)