require 'curses'
require 'fileutils'
require 'trollop'
-require 'fastthread'
require "sup"
BIN_VERSION = "git"
## BSD users: if libc.so.6 is not found, try installing compat6x.
require 'dl/import'
module LibC
- extend DL::Importable
+ extend DL.const_defined?(:Importer) ? DL::Importer : DL::Importable
setlocale_lib = case Config::CONFIG['arch']
when /darwin/; "libc.dylib"
when /cygwin/; "cygwin1.dll"
else; "libc.so.6"
end
- Redwood::log "dyamically loading setlocale() from #{setlocale_lib}"
+ Redwood::log "dynamically loading setlocale() from #{setlocale_lib}"
begin
dlload setlocale_lib
extern "void setlocale(int, const char *)"
Redwood::start
Index.load
- if(s = Index.source_for DraftManager.source_name)
+ if(s = Redwood::SourceManager.source_for DraftManager.source_name)
DraftManager.source = s
else
Redwood::log "no draft source, auto-adding..."
- Index.add_source DraftManager.new_source
+ Redwood::SourceManager.add_source DraftManager.new_source
end
- if(s = Index.source_for SentManager.source_name)
+ if(s = Redwood::SourceManager.source_for SentManager.source_uri)
SentManager.source = s
else
- Redwood::log "no sent mail source, auto-adding..."
- Index.add_source SentManager.new_source
+ Redwood::SourceManager.add_source SentManager.default_source
end
HookManager.run "startup"
bm.draw_screen
- Index.usual_sources.each do |s|
+ Redwood::SourceManager.usual_sources.each do |s|
next unless s.respond_to? :connect
reporting_thread("call #connect on #{s}") do
begin
end
end unless $opts[:no_initial_poll]
- imode.load_threads :num => ibuf.content_height, :when_done => lambda { reporting_thread("poll after loading inbox") { sleep 1; PollManager.poll } unless $opts[:no_threads] || $opts[:no_initial_poll] }
+ imode.load_threads :num => ibuf.content_height, :when_done => lambda { |num| reporting_thread("poll after loading inbox") { sleep 1; PollManager.poll } unless $opts[:no_threads] || $opts[:no_initial_poll] }
if $opts[:compose]
ComposeMode.spawn_nicely :to_default => $opts[:compose]