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:= self.chat.queue.get(id)
println('process_out [$id/$self.chat.queue.len()] $outmsg')
println('process_out queue keys $self.chat.queue.entries.keys() ${self.chat.queue.entries.keys().map(ptr_str(it))}')
match outmsg.system {
.irc {
ircnet_name := if outmsg.network.len == 0 {
if self.irc.networks.len > 0 { self.irc.networks[0].hostname } else { 'noname' }
} else {
outmsg.network
}
match self.irc.say(ircnet_name, outmsg.name, outmsg.room, outmsg.message) {
.good {
println('process_out queue.delete($id)')
self.chat.queue.delete(id)
if self.chat.queue.contains(id) {
outmsg := self.chat.queue.get(id)
println('process_out [$id/$self.chat.queue.len()] $outmsg')
println('process_out queue keys $self.chat.queue.entries.keys() ${self.chat.queue.entries.keys().map(ptr_str(it))}')
match outmsg.system {
.irc {
ircnet_name := if outmsg.network.len == 0 {
if self.irc.networks.len > 0 { self.irc.networks[0].hostname } else { 'noname' }
} else {
outmsg.network
.network_not_found {}
.user_not_found {
self.chat.cin <- chat.Payload(chat.MakeIrcUser{
network_hostname: ircnet_name
nick: outmsg.name
})
match self.irc.say(ircnet_name, outmsg.name, outmsg.room, outmsg.message) {
.good {
println('process_out queue.delete($id)')
self.chat.queue.delete(id)
}
.network_not_found {}
.user_not_found {
self.chat.cin <- chat.Payload(chat.MakeIrcUser{
network_hostname: ircnet_name
nick: outmsg.name
})
}
.error {}
}
.matrix {
if room := self.matrix.joined_rooms.find_room_by_id(outmsg.room) {
if self.matrix.owner == outmsg.name {
self.matrix.room_say(room, outmsg.message)
} else {
match self.matrix.room_say_as(outmsg.name, room, outmsg.message) {
.good {
self.chat.queue.delete(id)
if self.chat.queue.len() > 0 {
println('process_out finished ${id}. remaining queue len $self.chat.queue.len()')
.matrix {
if room := self.matrix.joined_rooms.find_room_by_id(outmsg.room) {
if self.matrix.owner == outmsg.name {
self.matrix.room_say(room, outmsg.message)
} else {
match self.matrix.room_say_as(outmsg.name, room, outmsg.message) {
.good {
self.chat.queue.delete(id)
if self.chat.queue.len() > 0 {
println('process_out finished ${id}. remaining queue len $self.chat.queue.len()')
}
}
.user_not_found {
self.matrix.cin <- matrix.Payload(matrix.MakeUser{
name: outmsg.name
})
}
.not_in_room {
p := matrix.Payload(matrix.JoinRoom{
name: outmsg.name
room: outmsg.room
})
match self.matrix.cin.try_push(p) {
.success {}
.not_ready { println('WARNING matrix.cin channel not ready. $self.matrix.cin.len entries') }
.closed {}
.user_not_found {
self.matrix.cin <- matrix.Payload(matrix.MakeUser{
name: outmsg.name
})
}
.error {
println('matrix room_say_as error. retainig msg for retransmission')
.not_in_room {
p := matrix.Payload(matrix.JoinRoom{
name: outmsg.name
room: outmsg.room
})
match self.matrix.cin.try_push(p) {
.success {}
.not_ready { println('WARNING matrix.cin channel not ready. $self.matrix.cin.len entries') }
.closed {}
}
}
.error {
println('matrix room_say_as error. retainig msg for retransmission')
}
} else {
println('listen_out matrix.joined_rooms.find_room_by_id failed: $err.msg dropped: $outmsg.message ')
println('process_out queue.delete($id)')
self.chat.queue.delete(id)