Permalink
Browse files

limit notify() server messages to 30 chars

  • Loading branch information...
Dale Maggee
Dale Maggee committed May 24, 2011
1 parent bd9ab59 commit 1671164817edc5c1bd01f5efaab7205a3585e7d5
Showing with 5 additions and 1 deletion.
  1. +5 −1 player.rb
View
@@ -105,7 +105,11 @@ def tunnel(direction)
end
def notify(text)
- message "Notify #{self}: '#{text}'" if $DEBUG
+ if $DEBUG
+ txt = text.gsub("\n","<LF>")
+ txt = txt[0..30] + '...' if txt.length > 32
+ message "Notify #{self}: '#{txt}'"
+ end
#encrypt text using @key, then base64 encode that so that DBus
# doesn't have a heart-attack transmitting binary data
crypt = Crypt::Blowfish.new(@key.force_encoding('ASCII'))

0 comments on commit 1671164

Please sign in to comment.