Ircxd.Message (ircxd v1.1.0)

Copy Markdown View Source

Parser and serializer for IRC messages.

Supports the modern IRC message shape, including IRCv3 message tags:

@time=2026-05-13T00:00:00Z :nick!user@host PRIVMSG #elixir :hello

Summary

Types

t()

A parsed IRC message.

Functions

Escapes an IRCv3 message-tag value.

Returns the maximum size of outgoing client tag data.

Returns the maximum IRC message size, including CRLF.

Returns the maximum IRC message size, excluding CRLF.

Returns the maximum number of IRC message parameters.

Returns the maximum size of a received tag section.

Returns the maximum received wire size with message tags.

Parses one IRC wire line.

Serializes a message and adds the final CRLF sequence.

Unescapes an IRCv3 message-tag value.

Returns true if client tag data meets the IRCv3 size limit.

Returns true if a command is alphabetic or a three-digit numeric.

Returns true if a received tag section meets the IRCv3 size limit.

Returns true if an outgoing line meets IRC wire-size limits.

Types

t()

@type t() :: %Ircxd.Message{
  command: String.t(),
  params: [String.t()],
  source: String.t() | nil,
  tags: %{optional(String.t()) => String.t() | true}
}

A parsed IRC message.

Functions

escape_tag_value(value)

Escapes an IRCv3 message-tag value.

max_client_tag_data_bytes()

Returns the maximum size of outgoing client tag data.

max_message_bytes()

Returns the maximum IRC message size, including CRLF.

max_message_bytes_without_crlf()

Returns the maximum IRC message size, excluding CRLF.

max_params()

Returns the maximum number of IRC message parameters.

max_received_tag_section_bytes()

Returns the maximum size of a received tag section.

max_received_wire_bytes()

Returns the maximum received wire size with message tags.

parse(line)

@spec parse(String.t()) :: {:ok, t()} | {:error, atom()}

Parses one IRC wire line.

serialize(message)

@spec serialize(t() | {String.t(), [String.t()]} | {String.t(), [String.t()], map()}) ::
  String.t()

Serializes a message and adds the final CRLF sequence.

unescape_tag_value(value)

Unescapes an IRCv3 message-tag value.

valid_client_tag_data_size?(tag_data)

Returns true if client tag data meets the IRCv3 size limit.

valid_command?(command)

Returns true if a command is alphabetic or a three-digit numeric.

valid_received_tag_section_size?(tag_section)

Returns true if a received tag section meets the IRCv3 size limit.

valid_wire_size?(line)

Returns true if an outgoing line meets IRC wire-size limits.