2VE7VSANN2FLMFG24PKRWZ43SUMQ5DODRJZC46WAB3A5WGMSPJPAC
NNQXLXID2SZLQZ7DEHN7RPXKFZQWS5O3TMIHGK75YGNHVQGSE2SQC
67NWZSMKBMJCQFHD7Q73GMCL76CAZPU3KT2NQBLWHEMQJ6XRK2RAC
Q4BJI3GMRJQIHHJF3QUXONZPFRFWFW22B24LVGDX4N2Y6PQDLJAAC
3WFDJ3HXPNBYJ5XDYP226SQCKZVY3PDIZNIEQUESZ2A4LOS7SHXQC
TJYIQNRLJHONKB6UEUP2CB2YNB2IGWCYZGF642G4HHVD3IAF6RBQC
S4P2B3FPF57HPHTIAYGMPCVKB7573IB5ZBKNXVBTB6ICCPF55WNQC
5C6575AV4JOMVQL4N6W76DMERCIE6TYIEK4GUMFOPMNZKPESYDGAC
L2IYR6USEM6XW4MVPLHBCK55LEHQK34H5VZF23M4F4MPEG2YIDLAC
BO5VKP6Z3GNEZN2RKCS4MSUYM77L3KSOJAFGZO4GPDPSZAHQ7PSQC
WMPPHPYAXJNLWZEDJOTHIIYUT627ZI27K5IF7JXVO7EYU7YENUKAC
IF2DHIDP45VLM5YEAHCHURS6EV4F2CHGRPCCAEFGF5F4JOZBE6RQC
SUH4BQLPGHDR2W2VCWZOXG2CU3RRFBMWAH4EQIFKO4SB4YRNJRRQC
return self.call(http.Method.post, 'createRoom', user_data.str())
user_data['is_direct'] = true
params, code := self.call(http.Method.post, 'createRoom', user_data.str()) or { return err }
if code == 200 {
room := &Room{
id: params['room_id'].str()
name: room_alias
}
return room
} else {
return error('code $code')
}
if this_room := self.matrix.joined_rooms.find_room_by_name(self.config.admin_room) {
room = this_room
if room := self.matrix.joined_rooms.find_room_by_name(self.config.admin_room) {
self.chat.say(chat.System.matrix, '', self.config.matrix_host, room.id, msg)
if this_room := self.matrix.joined_rooms.dm(self.config.matrix_owner) {
room = this_room
} else {
println('warning admin_say has no private room with ${self.config.matrix_owner}. dropping msg $msg')
self.matrix_say(self.config.matrix_owner, msg)
}
}
pub fn (mut self Main) matrix_say(user string, msg string) {
mut room := matrix.Room{}
if this_room := self.matrix.joined_rooms.dm(user) {
room = this_room
} else {
println('warning main.matrix_say has no private room with ${user}. creating room')
room = self.matrix.room_create(user) or {
println('main.matrix_say create_room $user failed. $err')
return
}
if room.id.len > 0 { // hack
self.chat.say(chat.System.matrix, '', self.config.matrix_host, room.id, msg)
println('warning main.matrix_say created room ${room}. inviting $user')
self.matrix.room_invite(room, user) or {
println('main.matrix_say invite $room $user failed. $err')
return
}