VSXY63RCAE4WDARTVOW6YDD6VPMRBNASRD73R4UMZDAAQX7MAVTAC
4ESWSPWWCLHCPFKW7GVVNUIF4UWXXF4KQS5DF5REFWV4TWXFZLSQC
ACKV7HCNDGXHGAKII3K6UUCXDJLDPODNEO3UQTWQ6HUY236DB6TAC
M5GXUK5HZE7HPLWQ33T73CXRJITOUJAO6T6F6QWTYYL7NLWFYA3AC
S4P2B3FPF57HPHTIAYGMPCVKB7573IB5ZBKNXVBTB6ICCPF55WNQC
BO5VKP6Z3GNEZN2RKCS4MSUYM77L3KSOJAFGZO4GPDPSZAHQ7PSQC
PFE537UQPEHTZAMPKTXNTJF6Z56PA2LQNAQHEOVTD2ZQRTFUTJKAC
C2FNNPGU3SEXQ64I3MZPA4JQOEKRBMYP3ZTGU4ZYOSN6M7B5CV3QC
F35KMTI4GH5AWL52CJFR767KIAD6TYXIT6PEHM65JJ66LRPESFTQC
4GYKYPKIACICEWYUOJNHU6D5FAUECBLNPUACURVDJPPIXO3RNICAC
I4SAB3ZORIAJOCA3KQIWVXBP4IDK3H7VUUJRTHPNGSPA7XCPJMCAC
match parts[1] {
'add' {
host := parts[2]
mut ircrow := []string{}
ircrow.push('') // id
ircrow.push(host)
ircrow.push('') // netname
self.db.add_irc_server(ircrow)
mut ircnet := irc.network_from_db(ircrow)
self.irc.networks.push(ircnet)
self.say_chan <- matrix.Say{
room: room_id
message: '$host added'
}
}
'del' {
mut ircnet := self.irc.find_server(parts[2]) or {
println('server del $parts[2] not found')
return
}
self.db.del_irc_server(ircnet.hostnames[0])
ircidx := self.irc.find_server_idx(ircnet)
self.irc.networks.delete(ircidx)
}
else {
default_action = true
}
}
fn (mut self Main) command_server(room_id string, parts []string) bool {
mut default_action := false
match parts[1] {
'add' {
host := parts[2]
mut ircrow := []string{}
ircrow.push('') // id
ircrow.push(host)
ircrow.push('') // netname
self.db.add_irc_server(ircrow)
mut ircnet := irc.network_from_db(ircrow)
self.irc.networks.push(ircnet)
self.say_chan <- matrix.Say{
room: room_id
message: '$host added'
}
}
'del' {
if ircnet := self.irc.find_server(parts[2]) {
self.db.del_irc_server(ircnet.hostnames[0])
ircidx := self.irc.find_server_idx(ircnet)
self.irc.networks.delete(ircidx)
} else {
println('server del $parts[2] not found')
}
}
else {
default_action = true
}
}
return default_action
}