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
class Chat < VPanel
class Info < Base
PUBLIC_KEY_LABEL = 'Public key: '
private
def draw
@ -33,8 +35,13 @@ module Widgets
addstr props[:status_message]
setpos 0, 1
addstr 'Public key: '
addstr props[: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]
end
end
end
end