Archived
1
0
Fork 0

Strip public key

This commit is contained in:
Braiden Vasco 2017-07-27 22:11:56 +00:00
parent 4361b6e4e3
commit e60e0a353f

View file

@ -3,6 +3,8 @@
module Widgets module Widgets
class Chat < VPanel class Chat < VPanel
class Info < Base class Info < Base
PUBLIC_KEY_LABEL = 'Public key: '
private private
def draw def draw
@ -33,9 +35,14 @@ module Widgets
addstr props[:status_message] addstr props[:status_message]
setpos 0, 1 setpos 0, 1
addstr 'Public key: ' addstr PUBLIC_KEY_LABEL
if PUBLIC_KEY_LABEL.length + props[:public_key].length > props[:width]
width = props[:width] - PUBLIC_KEY_LABEL.length
addstr "#{props[:public_key][0...(width - 3)]}..."
else
addstr props[:public_key] addstr props[:public_key]
end end
end end
end end
end
end end