Archived
1
0
Fork 0

Show error mark if message not received after 10 secs

This commit is contained in:
Braiden Vasco 2017-07-27 22:01:17 +00:00
parent 8e064c8ac0
commit 4361b6e4e3
2 changed files with 14 additions and 6 deletions

View file

@ -282,6 +282,7 @@ private
history: (state[:friends][friend_number][:history] + [
error: error,
out: true,
received: false,
time: Time.now.utc.freeze,
name: @tox_client.name.freeze,
text: text,

View file

@ -13,7 +13,14 @@ module Widgets
offset = 0
props[:messages].reverse_each do |msg|
offset += draw_message offset, msg[:error], msg[:out], msg[:time].strftime('%H:%M:%S'), msg[:name], msg[:text]
offset += draw_message(
offset,
msg[:error] || msg[:out] && !msg[:received] && Time.now.utc - msg[:time] > 10,
msg[:out],
msg[:time].strftime('%H:%M:%S'),
msg[:name],
msg[:text],
)
break if offset >= props[:height]
end