B:BD[
8.103] → [
7.916:1020]
∅:D[
7.1020] → [
9.624:657]
B:BD[
8.160] → [
9.624:657]
B:BD[
9.657] → [
7.1021:1051]
∅:D[
7.1051] → [
9.683:829]
B:BD[
9.683] → [
9.683:829]
B:BD[
9.829] → [
10.191:248]
∅:D[
10.248] → [
7.1052:1090]
∅:D[
11.93] → [
7.1052:1090]
B:BD[
9.857] → [
7.1052:1090]
B:BD[
7.1114] → [
7.1114:1162]
pub fn (mut self MatrixActor) call(method http.Method, api string, body string) ?map[string]json2.Any {
mut config := http.FetchConfig{
method: method
data: body
}
config.headers['Authorization'] = 'Bearer $self.token'
url := 'https://$self.host/_matrix/client/r0/$api'
resp := http.fetch(url, config) ?
println('$method $url => $resp.status_code $resp.text')
any := json2.raw_decode(resp.text) ?
return any.as_map() // as map[string]json2.Any
pub fn (mut self MatrixActor) user_presence(user_id string, status string) ?string {
mut evt := map[string]json2.Any{}
evt['presence'] = status
self.call(http.Method.put, 'presence/$user_id/$status', evt.str())
return ''