Fix hang on empty zcrypt messages

send_receive will never close wfd if out is an empty string.
Consequently, the zcrypt end will keep waiting for something
to encrypt (or decrypt), thereby deadlocking the barnowl.

This closes wfd if we aren't going to write anything to it.
Consequently, zcrypt will terminate quickly, and we'll also
return.

This fixes a deadlock when sending (at least it's the user's
fault) or receiving (this one is a DoS possibility) empty zcrypted
messages.
Rewrite call_filter to use g_spawn_async_with_pipes

This simplifies the error-handling code. Also fixes a bug where file
descriptors get double-closed in call_filter. Also adds a unit test. The
separate prog argument is removed to avoid having to deal with
G_SPAWN_FILE_AND_ARGV_ZERO, and since we don't really use it anyway.
zephyr: Add an iterator interface to fields

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
zephyr: Use field iterator interface to avoid quadratic loops

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Fix typo (thanks Sasen for reporting.)

Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
send_zephyr: Set z_charset = ZCHARSET_UTF_8

This allows X11 zwgc to display BarnOwl’s UTF-8 messages correctly,
since it doesn’t yet autodetect character sets of ZCHARSET_UNKNOWN
messages (http://zephyr.1ts.org/ticket/75).

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Complete viewperson and vp as viewuser and vu
Hide the default cursor with curs_set if supported

Then we don't leave it randomly at the right of the sepbar.
If zcrypt fails to decrypt, strip away the zcrypt opcode

Otherwise you can make a message look encrypted by sending it with a
faked 'crypt' opcode. It also confuses the reply command. Replace it
with 'failed-decrypt' just so it shows up in the UI somehow. Perhaps
someone can write perl code to retry zcrypt on all messages with that
opcode.

Also has the side effect of marking gibberish so the user has some hope
of realizing what happened if they sub to a zcrypted class without the
key.

And initialize out to NULL since there's actually a codepath where that
value never gets set.

Reported-by: Melissa Hunt <wings@mit.edu>
Include names of invalid filters

This makes errors in filters defined in startup files easier to find.
Otherwise, figuring out the name can be hard.
Remove emacs and vim files from .gitignore

If you want these ignored, put them in core.excludesfile (e.g.,
~/.gitignore) or in .git/info/excludes. The project itself doesn't
involve emacs or vim, and some people (like me) actually want to see
these in `git status`.

This reverts 1703f7231e2822e81916109bafcfebee606f7beb,
0741984c2bd338434f3ece168f6de9c4df82efa6, and
6b7e7a50c32181a4902b9f9d2a80105934f49a6b.
Put config.h.in~ back in .gitignore

It's generated by ./autogen.sh.
Add getnumlines() to perl interface
Fix race condition in starting up logger thread

The context should be created by the main thread. It's accessed by both
so, by the time owl_log_init returns, we need to be sure it exists.
Don't do the stderr redirect hack if !isatty(2)

stderr has already been redirected, so there's no point. This way if
barnowl crashes, we have some hope of recovering the stderr by
redirecting it to a file first. The pipe hack is still evil, but this is
somewhat less insane.
Use Digest::SHA in Jabber module instead of Digest::SHA1

The cool kids spell it without the 1 these days. More precisely,
Digest::SHA1 no longer exists in precise. Also it's in perl itself these
days.

(We can just install Digest::SHA into the locker for the sysnames that
need it.)
Merge pull request #100 from davidben/master

Use Digest::SHA in Jabber module instead of Digest::SHA1, since Digest::SHA1 has been abandoned and removed from distributions.
Document that the Facebook module wants a moose

Or a mouse apparently. Also that other dependency.
Facebook has EVEN MORE dependencies
Bump version for development.