Carl Worth [Thu, 20 Aug 2009 00:21:59 +0000 (17:21 -0700)]
convert a couple of arrays to sets for labels
This fixes some crashes when using 'l' in thread-view-mode that
have been present since commit 7aea418a8a62b7070eee764475fcfc0bdd8d58dd
("maintain labels as Sets rather than arrays").
Benoît PIERRE [Wed, 19 Aug 2009 20:56:55 +0000 (22:56 +0200)]
fix garbaged text in textfield when using ncursesw
Apparently, field_buffer content is not initialized to blanks when using
the wide-character version of ncurses. Forcing a call to
set_field_buffer fix the problem.
William Morgan [Tue, 11 Aug 2009 19:34:50 +0000 (15:34 -0400)]
refactor index access into three methods and rewrite PollManager#each_message_from
Couple big changes in this commit, but they're all tied together.
Index.sync_message is refactored into three separate methods: add_message,
update_message and update_message_state. The intention is that add_message is
called for new messages only, update_message is called for changing the method
body on disk (e.g. when we see multiple copies of the same message, or by
DraftManager when the text of a draft is changes), and update_message_state is
called when the labels on a message change. So indexes that differentiate those
operations can exhibit more natural performance characteristics.
Also, PollManager.add_messages_from has been renamed to each_message_from and
changed significantly. It now *only* yields successive messages; it does not
load the index version of the message, and it does not auto-add the message to
the index. (In fact, it ignores the result of the block.) There's also a new
method called add_new_message that calls Index.add_message and then relays the
update to other GUI elements.
There was a lot of refactoring of sup-sync that was part of this. Probably
not strictly necessary but it was too hard to untangle the changes.
William Morgan [Fri, 7 Aug 2009 01:33:19 +0000 (21:33 -0400)]
refactor index locking interaction and replace suicidemanager
Since SIGTERM now works, we have a better way of killing a remote
process than SuicideManager. So replace that with a $die global.
Also refactor the interactive locking code into a separate module
so as not to pollute index.rb with such trivial concerns.
William Morgan [Thu, 6 Aug 2009 16:21:46 +0000 (12:21 -0400)]
rewrap getch in select, handle sigwinch manually
This is necessary to operate with many versions of the ruby ncurses library,
all of which block threads when getch is being called. But this means we can't
use getch to determine a sigwich, since we won't see it until an actual key is
pressed. so we handle sigwinch ourselves.
William Morgan [Wed, 5 Aug 2009 19:40:02 +0000 (15:40 -0400)]
improve ncurses key handling for sigwinch and sigint
see comments. adding a nodelay call before each getch means we don't need a
select() call, which means that we can get sigwinch and sigint signals from
ncurses.
William Morgan [Wed, 24 Jun 2009 17:30:43 +0000 (13:30 -0400)]
bugfix: dates need to be truncated for xapian to index
If dates are way out of range, the current indexing process both dies
and generates bad doc ids. This patch forces dates to be within a
reasonable range (current between 1969 and 2038.) Not necessarily the
best solution.
William Morgan [Wed, 24 Jun 2009 13:10:19 +0000 (09:10 -0400)]
explicitly load index version, for better error messages
Catching the LoadError was masking errors from not having dependent
library like xapian and gdbm. This change makes the error messages
reflect what's actually missing. Since we're adding index types at
roughly once every 3 years, an explicit list like this shouldn't be too
difficult to maintain.
Rich Lane [Wed, 17 Jun 2009 00:24:59 +0000 (17:24 -0700)]
index: consistent naming
Replaced use of run_query with each_docid
Rename instances of ferret query objects to 'ferret_query'
Rename 'build_query' to 'build_ferret_query'
Rename hashes passed to index methods to 'query'
Rename 'parse_user_query_string' to 'parse_query'
Change 'parse_query' to return a query hash
Rename 'drop_entry' to 'delete' and modify callers to pass msgid
Rich Lane [Wed, 17 Jun 2009 00:24:58 +0000 (17:24 -0700)]
index: cleanup interface
Added the public methods 'each_docid', 'each_message', and 'optimize' to the
index. Removed the 'index' and 'ferret' accessors and modified their callers to
use the new methods. Bonus fixes: sup-dump no longer skips the first message
and sup_sync --start_at can now delete unseen messages.
Rich Lane [Fri, 12 Jun 2009 19:35:52 +0000 (12:35 -0700)]
fixes for ruby1.9
Change colons in case statements to 'then'
Fix a block that didn't take enough arguments
Rename variables to avoid shadowing warnings
Use String.ord (and define it for 1.8)
Use DL::Importer on 1.9
Make require 'fastthread' optional
Copy in RE_UTF8
Ben Walton [Sun, 7 Jun 2009 23:44:37 +0000 (19:44 -0400)]
Bounce Message Hook
Determine the command used to bounce a message based on a Hook instead
of a configuration option. Instead of writing an external script that
can send the message properly based on the recipient addresses, rely
on a hook that can return the command based on the From header in the
mail being bounced as well as the intended recipients. This is more
in line with the sup philosophy.
The default is still to strip any -t from the sendmail command of the
default account.
Signed-off-by: Ben Walton <bwalton@artsci.utoronto.ca>
Ben Walton [Sun, 7 Jun 2009 16:38:41 +0000 (12:38 -0400)]
Add message bouncing capability
Bouncing a message is akin to redirecting a mail with a .forward
entry. It is passed back to the mail system as it sits on disk.
By pressing ! while viewing a message, you can now re-inject it to the
mail system using either the command defined in bounce_sendmail or the
sendmail command for the default account with any instance of -t
removed. The user is prompted for the recipients of the message and is
offered a chance to confirm the bounce before it is sent.
The message is _not_ stored in the sent box, as this doesn't make
sense with bounced messages (and would not show up uniquely anyway).
The bounce_sendmail configuration item allows users that require
different sendmail commands depending on where the bounce is destined
to write a wrapper around their local mail tools to pick and choose
the appropriate injection method for the message based on the
addresses passed in. Most systems can likely use: sendmail -oem -i
Signed-off-by: Ben Walton <bwalton@artsci.utoronto.ca>
William Morgan [Fri, 5 Jun 2009 03:32:28 +0000 (23:32 -0400)]
make enter collapse current message in thread-view-mode
Pressing enter while over a text region in thread-view-mode will now
collapse the current message and move the cursor to the next open
message. (Behavior on quoted regions, sigs, attachments, etc. is
unchanged.)
This means that you can scan through a thread pretty rapidly by pressing
enter if you want to collapse the current message, or 'n' if you want
to keep it open.