mirror of
https://github.com/unrealircd/unrealircd.git
synced 2026-07-10 01:03:12 +02:00
"CAP LS" may only respond 1 line, we now advertise less. "CAP LS 302" unaffected.
When not using version 302, such as with "CAP LS", the specification does not allow us to use continuation lines. This means all advertised caps must fit into one line. That is no longer always the case, especially if you load 3rd party capabilities. So we need to scratch advertising some capabilities to <302 clients. "CAP LS 302" is unaffected. Note that version 302 in the specification exists since at least November 2017, so most clients use that one. According to https://ircv3.net/software/clients the following clients are affected by this change: Desktop Clients * KVIrc * Circe * catgirl * BitchX * Pidgin * LimeChat Mobile Clients * IRC for Android * LimeChat And various older versions of other clients (obviously). NOTE: The source is only that IRCv3 page. I did not check manually. For this particular commit. We filter out various unrealircd.org informative CAPs and the vendor specific json-log. So that isn't much of a problem. However, in the future we may be forced to filter out more capabilities to make room. It would be much better if all clients are on >=302. Also, I should mention we are not the only IRCd out there, so I can't vouch on what other IRCds (will) do when hitting this non-302-limit. Reported by ProgVal in https://bugs.unrealircd.org/view.php?id=6630
This commit is contained in:
@@ -165,6 +165,9 @@ static void clicap_generate(Client *client, const char *subcmd, int flags)
|
||||
if (cap->visible && !cap->visible(client))
|
||||
continue; /* hidden */
|
||||
|
||||
if (cap->minimum_cap_version && (client->local->cap_protocol < cap->minimum_cap_version))
|
||||
continue; /* skip: doesn't meet minimum CAP version */
|
||||
|
||||
if (flags)
|
||||
{
|
||||
if (!cap->cap || !(client->local->caps & cap->cap))
|
||||
|
||||
@@ -428,6 +428,7 @@ static void init_history_storage(ModuleInfo *modinfo)
|
||||
cap.name = "unrealircd.org/history-storage";
|
||||
cap.flags = CLICAP_FLAGS_ADVERTISE_ONLY;
|
||||
cap.parameter = history_storage_capability_parameter;
|
||||
cap.minimum_cap_version = 302;
|
||||
ClientCapabilityAdd(modinfo->handle, &cap, NULL);
|
||||
}
|
||||
|
||||
|
||||
@@ -54,6 +54,7 @@ MOD_INIT()
|
||||
|
||||
memset(&cap, 0, sizeof(cap));
|
||||
cap.name = "unrealircd.org/json-log";
|
||||
cap.minimum_cap_version = 302;
|
||||
c = ClientCapabilityAdd(modinfo->handle, &cap, &CAP_JSON_LOG);
|
||||
|
||||
memset(&mtag, 0, sizeof(mtag));
|
||||
|
||||
@@ -80,6 +80,7 @@ MOD_LOAD()
|
||||
cap.name = "unrealircd.org/link-security";
|
||||
cap.flags = CLICAP_FLAGS_ADVERTISE_ONLY;
|
||||
cap.parameter = link_security_capability_parameter;
|
||||
cap.minimum_cap_version = 302;
|
||||
ClientCapabilityAdd(modinfo->handle, &cap, NULL);
|
||||
|
||||
EventAdd(modinfo->handle, "checklinksec", checklinksec, NULL, 2000, 0);
|
||||
|
||||
@@ -71,5 +71,6 @@ void init_plaintext_policy(ModuleInfo *modinfo)
|
||||
cap.name = "unrealircd.org/plaintext-policy";
|
||||
cap.flags = CLICAP_FLAGS_ADVERTISE_ONLY;
|
||||
cap.parameter = plaintext_policy_capability_parameter;
|
||||
cap.minimum_cap_version = 302;
|
||||
ClientCapabilityAdd(modinfo->handle, &cap, NULL);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user