Skip to content

Commit

Permalink
Minor improvements to the server protocol docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
SadieCat committed Mar 12, 2024
1 parent e079a03 commit 4063225
Show file tree
Hide file tree
Showing 18 changed files with 17 additions and 30 deletions.
1 change: 0 additions & 1 deletion docs/server/messages/burst.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: BURST
phase:
- wait-auth-2
source: sid
syntax:
fields:
ts: The time at which the remote server started bursting. Used for clock synchronization.
Expand Down
3 changes: 2 additions & 1 deletion docs/server/messages/capab.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ extra: |-
Protocol Version | Supported By
---------------- | -------------
1202 | InspIRCd v2 — v3
1205 | InspIRCd v3
1205 | InspIRCd v3 & v4 (dev)
1206 | InspIRd v4 (dev)
If provided the capability-key fields can be set to one of the following values:
Expand Down
1 change: 0 additions & 1 deletion docs/server/messages/endburst.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
name: ENDBURST
source: sid
description: |-
Marks the source server as no longer bursting.
example:
Expand Down
1 change: 0 additions & 1 deletion docs/server/messages/fjoin.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
name: FJOIN
source: sid
syntax:
fields:
channel: The channel which is being introduced to the network.
Expand Down
13 changes: 9 additions & 4 deletions docs/server/messages/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ title: InspIRCd Spanning Tree Protocol — Messages

Messages are formatted the same as [a standard IRCv3 message](https://ircv3.net/specs/extensions/message-tags.html#format) other than the following differences:

- The prefix will be [a SID or UUID](/server/concepts/#uuids) instead of a nick!user@host mask.
- The prefix will be [a SID or UUID](/server/concepts/#uuids) instead of a nick!user@host mask. If no prefix is present then the message is from the directly connected server.
- Lines are terminated with a line feed (`\n`) instead of a carriage return and a line feed (`\r\n`).
- Support for arbitrary message tags is assumed and does not require negotiating a client capability.
- Tags that begin with a tilde (`~`) are internal to the server protocol and are not intended to be exposed to users.
Expand All @@ -26,14 +26,19 @@ This page only lists server messages. For details on user commands that may be s
</tr>
</thead>
{% for msg in server_messages -%}
{% if msg.source is defined %}
{% set prefix = ":<" ~ msg.source ~ ">" %}
{% else %}
{% set prefix = "[:<sid>]" %}
{% endif %}
<tr markdown="1">
<td markdown="1">[{{ msg.name }}](/server/messages/{{ msg.name | lower }}/)</td>
{% if msg.syntax is not defined %}
<td markdown="1">`{% if msg.source %}:<{{ msg.source }}> {% endif %}{{ msg.name }}`</td>
<td markdown="1">`{{ prefix }} {{ msg.name }}`</td>
{% elif msg.syntax.text is string %}
<td markdown="1">`{% if msg.source %}:<{{ msg.source }}> {% endif %}{{ msg.name }} {{ msg.syntax.text }}`</td>
<td markdown="1">`{{ prefix }} {{ msg.name }} {{ msg.syntax.text }}`</td>
{% else %}
<td markdown="1">{% for syntax in msg.syntax.text %}`{% if syntax.startswith("^") %}{{ msg.name }} {{ syntax[1:] }}{% else %}{% if msg.source %}:<{{ msg.source }}> {% endif %}{{ msg.name }} {{ syntax }}{% endif %}`{% if not loop.last %}<br>{% endif %}{% endfor %}</td>
<td markdown="1">{% for syntax in msg.syntax.text %}`{{ prefix }} {{ msg.name }} {{ syntax }}`{% if not loop.last %}<br>{% endif %}{% endfor %}</td>
{% endif %}
</tr>
{% endfor %}
Expand Down
1 change: 0 additions & 1 deletion docs/server/messages/metadata.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
name: METADATA
source: sid
syntax:
fields:
channel: The channel which the metadata applies to.
Expand Down
1 change: 0 additions & 1 deletion docs/server/messages/ping.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
name: PING
source: sid
syntax:
fields:
target: The identifier of the target server.
Expand Down
1 change: 0 additions & 1 deletion docs/server/messages/pong.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
name: PONG
source: sid
syntax:
fields:
target: The identifier of the target server.
Expand Down
1 change: 0 additions & 1 deletion docs/server/messages/resync.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
name: RESYNC
source: sid
syntax:
fields:
channel: The channel to resynchronize.
Expand Down
1 change: 0 additions & 1 deletion docs/server/messages/save.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
name: SAVE
source: sid
syntax:
fields:
uid: The UUID of the user to resolve the nick collision of.
Expand Down
3 changes: 1 addition & 2 deletions docs/server/messages/server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ phase:
- wait-auth-1
- wait-auth-2
- connected
source: sid
syntax:
fields:
server-name: The unique hostname of the new server.
Expand All @@ -13,7 +12,7 @@ syntax:
description: A description of the new server.
data: One or more key=value pairs which represent the state of a remote server.
text:
- ^<server-name> <password> <unused> <newsid> :<description>
- <server-name> <password> <unused> <newsid> :<description>
- <server-name> <newsid> [<data>]+ :<description>
description: |-
Introduces a server to the network.
Expand Down
1 change: 0 additions & 1 deletion docs/server/messages/sinfo.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
name: SINFO
source: sid
syntax:
fields:
key: The key which is being set.
Expand Down
1 change: 0 additions & 1 deletion docs/server/messages/snonotice.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
name: SNONOTICE
source: sid
syntax:
fields:
snochar: The [server notice character](/3/snomasks) that the message is associated with.
Expand Down
1 change: 0 additions & 1 deletion docs/server/messages/svsjoin.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
name: SVSJOIN
source: sid
syntax:
fields:
uid: The UUID of the user to join to the specified channel.
Expand Down
1 change: 0 additions & 1 deletion docs/server/messages/svsnick.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
name: SVSNICK
source: sid
syntax:
fields:
uid: The UUID of the user to change the nickname of.
Expand Down
1 change: 0 additions & 1 deletion docs/server/messages/svspart.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
name: SVSPART
source: sid
syntax:
fields:
uid: The UUID of the user to part from the specified channel.
Expand Down
1 change: 0 additions & 1 deletion docs/server/messages/uid.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
name: UID
source: sid
syntax:
fields:
uid: The UUID of the user who is being introduced
Expand Down
14 changes: 5 additions & 9 deletions mkdocs_inspircd/templates/servermsg.md.j2
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,18 @@ Fully connected | {% if "connected" in phase %}✔️{% else %}❌{% end
### Syntax

{% if source is defined %}
{% set prefix = " :<" ~ source ~ "> " %}
{% set prefix = ":<" ~ source ~ ">" %}
{% else %}
{% set prefix = "" %}
{% set prefix = "[:<sid>]" %}
{% endif %}

{% if syntax is not defined %}
`{{ prefix }}{{ name }}
`{{ prefix }} {{ name }}
{% elif syntax.text is string %}
`{{ prefix }}{{ name }} {{ syntax.text }}`
`{{ prefix }} {{ name }} {{ syntax.text }}`
{% else %}
{% for syntax_line in syntax.text %}
{% if syntax_line.startswith("^") %}
`{{ name }} {{ syntax_line[1:] }}`
{% else %}
`{{ prefix }}{{ name }} {{ syntax_line }}`
{% endif %}
`{{ prefix }} {{ name }} {{ syntax_line }}`
{% endfor %}
{% endif %}

Expand Down

0 comments on commit 4063225

Please sign in to comment.