sup

A curses threads-with-tags style email client

sup.git

git clone https://supmua.dev/git/sup/
commit 344ae55b4fe626431d800230843bddf5a93eb429
parent b98727cc2feb8175c6834e9b435796c333e96ee3
Author: William Morgan <wmorgan-sup@masanjin.net>
Date:   Wed,  2 Sep 2009 09:45:11 -0400

Revert "Merge branch 'after-add-message-hook' into next"

This reverts commit 67214e30d648ac9351b9898f8e1587d065264787.

This hook was causing sup-sync to fail on large mailboxes,
because it was keeping every message around in memory.

Diffstat:
M lib/sup/poll.rb | 10 ----------
1 file changed, 0 insertions(+), 10 deletions(-)
diff --git a/lib/sup/poll.rb b/lib/sup/poll.rb
@@ -11,12 +11,6 @@ Variables:
   message: the new message
 EOS
 
-  HookManager.register "after-add-message", <<EOS
-Executes after all messages are added to the index.
-Variables:
-  messages: an array of the new messages added
-EOS
-
   HookManager.register "before-poll", <<EOS
 Executes immediately before a poll for new messages commences.
 No variables.
@@ -143,7 +137,6 @@ EOS
     begin
       return if source.done? || source.has_errors?
 
-      messages = []
       source.each do |offset, source_labels|
         if source.has_errors?
           warn "error loading messages from #{source}: #{source.error.message}"
@@ -154,13 +147,10 @@ EOS
         m.labels += source_labels + (source.archived? ? [] : [:inbox])
         m.labels.delete :unread if m.source_marked_read? # preserve read status if possible
         m.labels.each { |l| LabelManager << l }
-        messages.push m
 
         HookManager.run "before-add-message", :message => m
         yield m
       end
-      HookManager.run "after-add-message", :messages => messages
-
     rescue SourceError => e
       warn "problem getting messages from #{source}: #{e.message}"
       Redwood::report_broken_sources :force_to_top => true