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AC
PA325CFTHH4SAQG74P3SBTOZZICVFYUFSMAG3TARZK4DH5OHJO4QC
4NLAKJMMFFEEJQRG254SIOP5O5GVOYY3XT2IUOVZO3OX3WS2AZXAC
MSGFBWV3HGXCKDV72P5I5U32ACVFGAOQ226LN36N5RM3ZXL6PTYAC
UK6XPPF2T3MHMEKWX4VB6TDTTRHQXHB2VS2DU6RY6K7WXQJV53RAC
P6WYORQDK37N5I6DDOYU6QYIUEBTVV47XTXJ4VLT3HNCED4D2CFAC
4NP67IZLLWWBY4M6GJUSCAWG3X5BKEBJQXNXQMM6GXIENYBPTNRAC
IJB4AS4C2G4SNTGRMW5ILQF3ZBMZE2ZUSK7JYKCRD4Q7H43ISECQC
CX76CSXNSDYGXHQI77DUWIG3YSVPNBA4JBY2EMUGL7WHMQBK5UDQC
2ARSV2LXCF5S6EKEU45RHZ2YNWHPIAA3VOT6X3TDAFLX4OYCP3TQC
OYO7SPBZRLTZHT22POUHC3KWVPU4XDWKSZAZ2I73IXOQGRW7VC3QC
B5EQK6YSRS2YL3C4MXWCOUDYDEOB46LXAZNRCSXC7STIME7W6JQAC
5XI5H2KXX5E22S5LBN7DJZGORBCCIFJAUEL6QGWXN5BD5X4MTMWAC
WTNDGSY5GEQDLT3LC7NEO6MC524VMMBCWKHB7BQ4NOPORVUYYTZQC
mut ghost := ircnet.ghosts.by_nick(nick) or {
println('irc.say() ghost nick "$nick" not found in ${network}. (msg was: $message)')
mut puppet := self.puppets.by_net_nick(ircnet, nick) or {
println('irc.say() puppet nick "$nick" not found in ${network}. (msg was: $message)')
if ghost := ircnet.ghosts.by_nick(nick) {
return ghost
}
}
return error('not found')
}
pub fn (mut self IrcActor) find_server(addr string) ?&Network {
for mut ircnet in self.networks {
if ircnet.name == addr || ircnet.hostname == addr {
mut p_ircnet := *ircnet // vbug
if p_ircnet.hostname == addr {
for mut ircnet in self.networks {
mut ghost := ircnet.find_ghost(ircnet.nick) or {
mut ghost := self.new_ghost(mut ircnet, ircnet.nick)
ircnet.ghosts.add(mut ghost)
for mut ircnet in self.networks.networks {
mut n_ircnet := *ircnet // vbug
mut ghost := self.puppets.by_net_nick(n_ircnet, ircnet.nick) or {
mut n_ghost := self.new_ghost(mut n_ircnet, ircnet.nick)
self.puppets.add(mut n_ghost)
pub fn (mut self IrcActor) dial(mut ircnet Network, nick string) SockOrNone {
mut host := ircnet.hostname
pub fn dial(hostname string, nick string) SockOrNone {
mut host := hostname
pub fn (self Network) join(channel string, nick string) {
println('Network.join($channel, $nick)')
pub fn (mut self Puppet) dial() {
self.sock = dial(self.network.hostname, self.nick)
if self.sock is net.TcpConn {
self.state = .connected
} else {
self.state = .disconnected
}
}
pub fn (mut self Puppet) join(channel string) {
println('$self.nick joining $channel')
mut ghost := self.ghosts.by_nick(nick) or {
println('irc.join() ghost nick "$nick" not found in ${self}. (msg was: $cmd)')
return
}
self.write(mut ghost, cmd)
self.write(cmd)
}
pub fn (self Network) find_ghost(nick string) ?&Ghost {
for mut ghost in self.ghosts.ghosts {
g_ghost := *ghost // vbug
if g_ghost.nick == nick {
return ghost
}
}
return error('not found')
pub fn (mut self Network) hangup() {
for mut ghost in self.ghosts.ghosts {
ghost.hangup()
pub fn (mut self Puppets) hangup(ircnet &Network) {
for mut puppet in self.puppets {
if puppet.network.name == ircnet.name {
puppet.hangup()
}
for ircnet in self.networks {
if ghost := ircnet.ghosts.by_nick(nick) {
if channel := ghost.channels.find_by_name(channel_name) {
return channel
} else {
println('irc.find_channel_by_name() $ghost.nick ghost ${ptr_str(ghost)} has no $channel_name')
dump(ghost.channels)
}
if ghost := self.puppets.by_nick(nick) {
if channel := ghost.channels.find_by_name(channel_name) {
return channel
} else {
println('irc.find_channel_by_name() $ghost.nick ghost ${ptr_str(ghost)} has no $channel_name')
dump(ghost.channels)
pub fn (self Ghosts) by_nick(nick string) ?&Ghost {
for g in self.ghosts {
pub fn (self Puppets) by_network(netname string) []&Puppet {
mut winners := []&Puppet{}
for g in self.puppets {
if g.network.name == netname {
winners << g
}
}
return winners
}
pub fn (self Puppets) by_nick(nick string) ?&Puppet {
for mut g in self.puppets {
println("irc.Ghosts.by_nick(\"$nick\") found ghost.nick ${ptr_str(g.nick)} \"$g.nick\" ")
println("irc.Puppets.by_nick(\"$nick\") found ghost.nick ${ptr_str(g.nick)} \"$g.nick\" ")
return g
}
}
return error('not found')
}
pub fn (mut self Networks) add(network &Network) &Network {
self.networks << network
return self.networks.last() // network was copied. return copy.
}
pub fn (mut self Networks) by_name(name string) ?&Network {
for mut g in self.networks {
if g.name == name {
return g
}
}
return error('not found')
}
pub fn (self Puppets) by_net_nick(ircnet Network, nick string) ?&Puppet {
for g in self.puppets {
if g.nick == nick && g.network.name == ircnet.name {
println("irc.Puppets.by_net_nick(\"$ircnet.name\" \"$nick\") found ghost.nick ${ptr_str(g.nick)} \"$g.nick\" ")
pub fn (self Network) write(mut ghost Ghost, msg string) {
if mut ghost.sock is net.TcpConn {
println('$self.hostname $ghost.nick: $msg')
ghost.sock.write_string(msg + '\n') or {}
pub fn (mut self Puppet) write(msg string) {
if mut self.sock is net.TcpConn {
println('$self.network $self.nick: $msg')
self.sock.write_string(msg + '\n') or {}
pub fn (mut self Ghosts) add(mut ghost Ghost) &Ghost {
self.ghosts << ghost
mut first := self.ghosts.last() // pointers()[0] // hack around vlang crazy ptr mgmt
return first // array add was copied. return copy.
pub fn (mut self Puppets) add(mut puppet Puppet) &Puppet {
self.puppets << puppet
return self.puppets.last() // puppet was copied. return copy.
mut msg := '$self.matrix.host is $self.matrix.conn_state in $self.matrix.joined_rooms.len() rooms. $self.irc.networks.len irc networks connected.'
mut msg := '$self.matrix.host is $self.matrix.conn_state in $self.matrix.joined_rooms.len() rooms. $self.irc.networks.networks.len irc networks connected.'
mut new_ircnet := self.irc.find_server(irc_temp.hostname) or { return false }
go self.irc.dial(mut new_ircnet, new_ircnet.nick)
mut new_ircnet := self.irc.networks.add(irc_temp)
mut bot_puppet := self.irc.new_ghost(mut new_ircnet, new_ircnet.nick)
go bot_puppet.dial()
for ghost in ircnet.ghosts.ghosts {
msg2 := '${ircnet.name}($ircnet.hostname) $ghost.nick $ghost.channels.channels.len channels'
for puppet in self.irc.puppets.puppets {
msg2 := '$ircnet $puppet.nick $puppet.channels.channels.len channels'
for ircnet in self.irc.networks {
for mut ghost in ircnet.ghosts.ghosts {
vghost := *ghost // VBUG
d_msg := 'nicksync $alias.irc == $vghost.nick'
self.chat.say(system, '', network, room_id, d_msg)
if old_nick == vghost.nick {
msg := 'changing $ircnet.name $vghost.nick to $nick'
self.chat.say(system, '', network, room_id, msg)
ircnet.nick(mut *ghost, nick)
}
}
mut puppet := self.irc.puppets.by_nick(alias.irc) or {
d_msg := 'nick $alias.irc not found'
self.chat.say(system, '', network, room_id, d_msg)
return false
}
d_msg := 'nicksync $alias.irc == $puppet.nick'
self.chat.say(system, '', network, room_id, d_msg)
if old_nick == puppet.nick {
msg := 'changing $puppet.network $puppet.nick to $nick'
self.chat.say(system, '', network, room_id, msg)
puppet.nick(nick)
for ircnet in self.irc.networks {
for ghost in ircnet.ghosts.ghosts {
p_msg = '$ircnet.name $ghost.nick'
for ircnet in self.irc.networks.networks {
puppets := self.irc.puppets.by_network(ircnet.name)
for puppet in puppets {
p_msg = '$ircnet $puppet.nick'
for mut ghost in ircnet.ghosts.ghosts {
mut g_ghost := *ghost // vbug
if g_ghost.nick == name {
if g_ghost.state == .disconnected {
msg = 'connecting to $ircnet.hostname'
self.chat.say(system, '', network, room_id, msg)
g_ghost.sock = self.irc.dial(mut ircnet, ircnet.nick)
}
}
if puppet.state == .disconnected {
msg = 'connecting to $puppet.network'
self.chat.say(system, '', network, room_id, msg)
puppet.dial()
println('sync_irc_channels() $ircnet $ghost.nick joining $channel from db')
ircnet.join(channel, ghost.nick)
println('sync_irc_channels() $ircnet $ghost joining $channel from db')
// mut ghost_hack := self.irc.puppets.by_nick(ghost.nick) or { continue }
// ghost_hack.join(channel)