class

Circed::Network::NetworkState

Inherits Reference / Object

Global network state manager for RFC 2813 compliance Maintains network-wide information about servers, users, and channels

Constants

NICKNAME_DELAY = 30.seconds

Class methods

add_channel(name : String, created_at : Time = Time.unix(Time.utc.to_unix))

Add channel to global network state

Source
add_user(nickname : String, username : String, hostname : String, realname : String, server : String, hopcount : Int32 = 0, connected_at : Time = Time.unix(Time.utc.to_unix)) : Bool

Add user to global network state

Source
apply_channel_modes(name : String, mode_string : String, params : Array(String), created_at : Time | Nil = nil, parameter_index : Int32 = 0) : Bool
Source
channels
Source
clear_all_state

Clear all state (for testing)

Source
get_channel(name : String)
Source
get_server(name : String)
Source
get_user(nickname : String)
Source
join_user_to_channel(nickname : String, channel_name : String, modes : Set(Char) = Set(Char).new)

Join user to channel

Source
merge_channel(name : String, created_at : Time, modes : Set(Char)) : Bool
Source
nickname_reserved?(nickname : String) : Bool
Source
part_user_from_channel(nickname : String, channel_name : String)

Part user from channel

Source
remove_channel(name : String)

Remove channel from global network state

Source
remove_server(name : String, send_squit : Bool = true)

Remove server and cascade to users/channels

Source
remove_user(nickname : String)

Remove user from global network state - optimized

Source
route_to_server(target_server : String, from_server : String = Server.name) : String | Nil

Find route to server (for message routing)

Source
server_list(mask : String | Nil = nil)

Generate server list for LINKS command

Source
servers

Query methods

Source
set_channel_topic(name : String, topic : String | Nil, set_by : String | Nil = nil, set_at : Time = Time.unix(Time.utc.to_unix), created_at : Time | Nil = nil) : Bool

Set topic for a channel

Source
set_user_away(nickname : String, message : String | Nil)

Set away message for a user - optimized

Source
stats

Network statistics

Source
sync_channel(channel : Domain::Channel) : Nil
Source
sync_channel_repository(name : String) : Nil
Source
topology
Source
user_routed_through?(nickname : String, server_name : String) : Bool
Source
users
Source

Nested types