HA7HWWCWLZNJVHU7BI4IL5HTT26V44HJKDRZHXMT5AN6B7NH7N6AC
VDRC3JXJMIYZ65PDFUBKHJGMKWIBFGYU4WPF43OOXHKTL2UBFKEAC
H7PPEYC35JOQ2NSSEYVPTFWZBNO5WXRWG5X3XR3JGX5R2BBU5WWAC
S4P2B3FPF57HPHTIAYGMPCVKB7573IB5ZBKNXVBTB6ICCPF55WNQC
QWIXQSP22VFGDT23HBBOAHSCPQBWYJHBDD3SDECPB6J6WWKKYLLAC
AETEUT6ER7MJXNYTBH5RHUT5URSRWNBJPXU2CA4URLSNAZYMWPIAC
YLSNKGUDSJN3S37GCAHLNBIK22PVZNLFFLMFGM533XGZ56FVHLZQC
4SFN5L36NYBFPXLBSWXO4KXDBY2W4YP4CNNVX23E2BQ7W2A6GVZQC
YHNJXHEFIHKZUGR22VCEZQLWR6AADOMXN4GURZXZRXOTWEOZO7AAC
THULBVNUJHXMNETYBU2WSMFWD7VPSSNPSOAAVVINL7LIOENEHZRQC
JFLKJBID7LCJ7KIIYBWTQZT3TO2WSZHRKRCZTHUXBMS5PTBRZYZAC
55NYCTVRAG7AFJJGNOKSB6NFFNWG5DOMCNZS2JM6EV6MUWCTD2JQC
7755FHS7ZTG4YGJNFYAONWSWSM636WOWFRISDKQU2AOJHN6ZVMBAC
UVGQA4JL7UY6HSEMU2JDRZLT44QJAVKV6ZBMWOFHDFHJZLTM5NKAC
LE5S25TSDLEYUHK7WQINNHJGSZNFR5XBFXSV567X4ZSVGRVT3UFQC
self.call('account/whoami')
kv := self.call_get('account/whoami') or { println("whoami fail $err") return error("z")}
return kv['user_id'] as string
}
pub fn (mut self MatrixActor) register(user_id string) ?string {
mut user_data := map[string]json2.Any{}
user_data["username"] = user_id
user_data["type"] = "m.login.application_service"
println(user_data)
kv := self.call(http.Method.post, 'register', user_data.str()) ?
if 'errcode' in kv {
println('register error!')
} else {
return kv['user_id'] as string
}