From: William Morgan Date: Sun, 24 Feb 2008 22:31:52 +0000 (-0800) Subject: giving a block to PollManager#each_message_in_source is now optional X-Git-Url: https://git.notmuchmail.org/git?a=commitdiff_plain;h=b5c1bcbd4c25618574f94e683773647906f023e0;p=sup giving a block to PollManager#each_message_in_source is now optional The block is only there to allow tweaks to the message before insertion. It's perfectly useful to call this method without the block. --- diff --git a/lib/sup/poll.rb b/lib/sup/poll.rb index 2dd9150..d32c893 100644 --- a/lib/sup/poll.rb +++ b/lib/sup/poll.rb @@ -156,7 +156,7 @@ EOS docid, entry = Index.load_entry_for_id m.id HookManager.run "before-add-message", :message => m - m = yield(m, offset, entry) or next + m = yield(m, offset, entry) or next if block_given? Index.sync_message m, docid, entry UpdateManager.relay self, :added, m unless entry rescue MessageFormatError => e