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TDU5RY2ABF6DKRWS5FURPIG5PWQC
K7K3EWO4H75J63G3IREKSPGBVBF6LFZHD4WRKGQTWUYTYGHWQ22QC
GOQKAC5U66BDKPV2O7XALAHBW3UWJOM6SGOV3T4455NN52MJUSPAC
matrix_host string = 'homeserver.example'
as_token string = 'fixme'
as_port int = 9090
rpc_port int = 8099
admin_room string
matrix_host string = 'homeserver.example'
matrix_owner string
as_token string = 'fixme'
as_port int = 9090
rpc_port int = 8099
admin_room string
conn_state ConnState
last_say time.Time
rooms []Room
whoami string
conn_state ConnState
last_say time.Time
joined_rooms Rooms
whoami string
}
struct Rooms {
pub mut:
rooms []Room
if self.rooms.len > 0 {
// self.room_state(rooms[0])
self.room_messages(self.rooms[0])
self.room_say(self.rooms[0], 'irc bridge started. homeserver $self.host')
if self.joined_rooms.len() > 0 {
if room := self.joined_rooms.dm(self.owner) {
self.room_say(room, 'irc bridge started. homeserver $self.host')
}
pub fn (mut self Actor) join(room_id string) string {
self.call(http.Method.post, 'rooms/$room_id/join', '') or {}
return ''
pub fn (mut self Actor) join(room_id string) ?(map[string]json2.Any, int) {
return self.call(http.Method.post, 'rooms/$room_id/join', '')
pub fn (mut self Actor) room_name(room_id string) ?string {
println('room_name: searching $self.rooms.len rooms')
for mut room in self.rooms {
println('room_name comparing $room.id to $room_id')
if room.id == room_id {
return room.name
}
}
return error('room_name not in room list')
}
}
pub fn (mut self Rooms) replace(rooms []&Room) {
self.rooms.clear()
// VBUG self.rooms << rooms
for r in rooms {
self.rooms << r
}
}
pub fn (mut self Rooms) add(room Room) {
self.rooms << room
}
pub fn (mut self Rooms) delete(room_id string) {
}
pub fn (mut self Rooms) len() int {
return self.rooms.len
}
pub fn (mut self Rooms) dm(user string) ?Room {
return self.rooms[0]
}
pub fn (mut self Rooms) find_room(room_id string) ?Room {
for room in self.rooms {
if room.id == room_id {
return room
}
}
return error('room \"$room_id\" not found')
}
pub fn (mut self Rooms) room_name(room_id string) ?string {
println('room_name: searching $self.rooms.len rooms')
for mut room in self.rooms {
println('room_name comparing $room.id to $room_id')
if room.id == room_id {
return room.name
}
}
return error('room_name not in room list')
mut msg := '$self.matrix.host is $self.matrix.conn_state in $self.matrix.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.len irc networks connected.'