lib/ayadn/workers.rb in ayadn-1.7.4 vs lib/ayadn/workers.rb in ayadn-1.7.5
- old
+ new
@@ -111,11 +111,13 @@
obj[:name].length > 23 ? name = "#{obj[:name][0..20]}..." : name = obj[:name]
table << [ "@#{username} ".color(Settings.options[:colors][:username]), "#{name}", posts_day ]
else
table << [ "@#{username} ".color(Settings.options[:colors][:username]), "", posts_day ]
end
- table << :separator unless index + 1 == list.length
+ if index + 1 != list.length && Settings.options[:timeline][:compact] == false
+ table << :separator
+ end
end
table
end
# builds a hash of hashes, each hash is a normalized post with post id as a key
@@ -470,10 +472,15 @@
end
end
sentences << words.join(' ')
words = Array.new
end
- sentences.join("\n")
+ if Settings.options[:timeline][:compact] == true
+ without_linebreaks = sentences.keep_if { |s| s != "" }
+ without_linebreaks.join("\n")
+ else
+ sentences.join("\n")
+ end
end
def links_from_posts(stream)
links = []
stream['data'].each do |post|