prepare for msg read arrow change

master
Nicolò Balzarotti 2018-09-18 09:27:14 +02:00
parent c198959fd7
commit 2bee38d4af
1 changed files with 8 additions and 5 deletions

View File

@ -50,17 +50,20 @@ end
using Dates using Dates
function Base.show(io::IO, m::MatrixMsg; muser::Union{Nothing,MatrixUser} = nothing) function Base.show(io::IO, m::MatrixMsg; muser::Union{Nothing,MatrixUser} = nothing)
global user global user
dirforward = false
if muser === nothing if muser === nothing
if isdefined(MatrixChat, :user) if isdefined(MatrixChat, :user)
direction = m.sender == user ? dirforward = m.sender == user
" ««« " : " »»» "
else
direction = " »»» "
end end
else else
direction = " »»» " dirforward = m.sender == muser
end end
# read = m.isread
read = false
direction = dirforward ? (read ? " ««« " : " <<< ") :
(read ? " »»» " : " >>> ")
d = Dates.epochms2datetime(m.timestamp + d = Dates.epochms2datetime(m.timestamp +
Dates.datetime2epochms(Dates.unix2datetime(0))) Dates.datetime2epochms(Dates.unix2datetime(0)))
dtfmt = if Dates.Hour(now()) - Dates.Hour(d) < Dates.Hour(24) dtfmt = if Dates.Hour(now()) - Dates.Hour(d) < Dates.Hour(24)