diff --git a/src/tui.jl b/src/tui.jl index 6129858..3319876 100644 --- a/src/tui.jl +++ b/src/tui.jl @@ -3,3 +3,26 @@ roomlist = Dict() function updateroomlist(user::MatrixUser) global roomlist = listjoined(user) end + +function startsync() + background_sync(syncstatus) + + function showevent(_...) + global syncstatus + let ks = syncstatus.sync["rooms"]["join"] + for k in keys(ks) + try + for msg in ks[k]["timeline"]["events"] + println(MatrixMsg(msg["sender"], + msg["origin_server_ts"], + msg["content"]["msgtype"], + msg["content"]["body"])) + end + catch + continue + end + end + end + end + set_hook!(:sync, showevent) +end