commit a6a3270f39f4e7c6c45ab9e8a352d1d2591c0699
parent 88779f92368cb85057d10dce751c04ef15cee803
Author: Dan Callaghan <djc@djc.id.au>
Date: Mon, 1 Jan 2024 13:47:17 +1100
fix unused variable warnings in Thread
Diffstat:
1 file changed, 20 insertions(+), 20 deletions(-)
diff --git a/lib/sup/thread.rb b/lib/sup/thread.rb
@@ -86,22 +86,22 @@ class Thread
end
end
- def first; each { |m, *o| return m if m }; nil; end
- def has_message?; any? { |m, *o| m.is_a? Message }; end
- def dirty?; any? { |m, *o| m && m.dirty? }; end
- def date; map { |m, *o| m.date if m }.compact.max; end
+ def first; each { |m, *| return m if m }; nil; end
+ def has_message?; any? { |m, *| m.is_a? Message }; end
+ def dirty?; any? { |m, *| m && m.dirty? }; end
+ def date; map { |m, *| m.date if m }.compact.max; end
def snippet
- with_snippets = select { |m, *o| m && m.snippet && !m.snippet.empty? }
- first_unread, * = with_snippets.select { |m, *o| m.has_label?(:unread) }.sort_by { |m, *o| m.date }.first
+ with_snippets = select { |m, *| m && m.snippet && !m.snippet.empty? }
+ first_unread, * = with_snippets.select { |m, *| m.has_label?(:unread) }.sort_by { |m, *| m.date }.first
return first_unread.snippet if first_unread
- last_read, * = with_snippets.sort_by { |m, *o| m.date }.last
+ last_read, * = with_snippets.sort_by { |m, *| m.date }.last
return last_read.snippet if last_read
""
end
- def authors; map { |m, *o| m.from if m }.compact.uniq; end
+ def authors; map { |m, *| m.from if m }.compact.uniq; end
- def apply_label t; each { |m, *o| m && m.add_label(t) }; end
- def remove_label t; each { |m, *o| m && m.remove_label(t) }; end
+ def apply_label t; each { |m, *| m && m.add_label(t) }; end
+ def remove_label t; each { |m, *| m && m.remove_label(t) }; end
def toggle_label label
if has_label? label
@@ -113,24 +113,24 @@ class Thread
end
end
- def set_labels l; each { |m, *o| m && m.labels = l }; end
- def has_label? t; any? { |m, *o| m && m.has_label?(t) }; end
- def each_dirty_message; each { |m, *o| m && m.dirty? && yield(m) }; end
+ def set_labels l; each { |m, *| m && m.labels = l }; end
+ def has_label? t; any? { |m, *| m && m.has_label?(t) }; end
+ def each_dirty_message; each { |m, *| m && m.dirty? && yield(m) }; end
def direct_participants
- map { |m, *o| [m.from] + m.to if m }.flatten.compact.uniq
+ map { |m, *| [m.from] + m.to if m }.flatten.compact.uniq
end
def participants
- map { |m, *o| [m.from] + m.to + m.cc + m.bcc if m }.flatten.compact.uniq
+ map { |m, *| [m.from] + m.to + m.cc + m.bcc if m }.flatten.compact.uniq
end
- def size; map { |m, *o| m ? 1 : 0 }.sum; end
- def subj; argfind { |m, *o| m && m.subj }; end
- def labels; inject(Set.new) { |s, (m, *o)| m ? s | m.labels : s } end
+ def size; map { |m, *| m ? 1 : 0 }.sum; end
+ def subj; argfind { |m, *| m && m.subj }; end
+ def labels; inject(Set.new) { |s, (m, *)| m ? s | m.labels : s } end
def labels= l
raise ArgumentError, "not a set" unless l.is_a?(Set)
- each { |m, *o| m && m.labels = l.dup }
+ each { |m, *| m && m.labels = l.dup }
end
def latest_message
@@ -360,7 +360,7 @@ class ThreadSet
## merges in a pre-loaded thread
def add_thread t
raise "duplicate" if @threads.values.member? t
- t.each { |m, *o| add_message m }
+ t.each { |m, *| add_message m }
end
## merges two threads together. both must be members of this threadset.