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