MatrixChat.jl/src/tui.jl

34 lines
977 B
Julia

roomlist = Dict()
function updateroomlist(user::MatrixUser)
global roomlist = listjoined(user)
end
function startsync()
global syncstatus
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"]
# Go up
print("\033[F")
end
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