diff options
author | René 'Necoro' Neumann <necoro@necoro.net> | 2010-12-02 13:00:10 +0100 |
---|---|---|
committer | René 'Necoro' Neumann <necoro@necoro.net> | 2016-03-25 22:40:56 +0100 |
commit | 3846e0d7d177e5328c6650bc49d46a0497dceac2 (patch) | |
tree | 564bfc66fe967653a3824240d130461f96d15008 /lib | |
parent | 74e39f415c7d7a7bb2f61700b07b854a212446b6 (diff) | |
download | feed2imap-groups.tar.gz feed2imap-groups.tar.bz2 feed2imap-groups.zip |
Fix pythonismgroups
Diffstat (limited to 'lib')
-rw-r--r-- | lib/feed2imap/config.rb | 32 |
1 files changed, 15 insertions, 17 deletions
diff --git a/lib/feed2imap/config.rb b/lib/feed2imap/config.rb index 3e43292..b94ffc1 100644 --- a/lib/feed2imap/config.rb +++ b/lib/feed2imap/config.rb @@ -69,7 +69,7 @@ class F2IConfig @imap_accounts = ImapAccounts::new @maildir_account = MaildirAccount::new - @conf['feeds'].each &(push_feed @target.to_s) + @conf['feeds'].each { |f| push_feed @target.to_s, f } end def calc_target(global, new) @@ -85,22 +85,20 @@ class F2IConfig end end - def push_feed(target) - Proc.new do |f| - if f.has_key? 'group' - ftarget = calc_target(target, (f.has_key? 'target') ? f['target'].to_s : f['group'].to_s) - f['feeds'].each &(push_feed ftarget) - elsif f['disable'].nil? - ftarget = calc_target(target, (f.has_key? 'target') ? f['target'].to_s : f['name'].to_s) - uri = URI::parse(Array(ftarget).join('')) - path = URI::unescape(uri.path) - if uri.scheme == 'maildir' - @feeds.push(ConfigFeed::new(f, @maildir_account, path, self)) - else - # remove leading slash from IMAP mailbox names - path = path[1..-1] if path[0,1] == '/' - @feeds.push(ConfigFeed::new(f, @imap_accounts.add_account(uri), path, self)) - end + def push_feed(target, f) + if f.has_key? 'group' + ftarget = calc_target(target, (f.has_key? 'target') ? f['target'].to_s : f['group'].to_s) + f['feeds'].each { |f| push_feed ftarget, f} + elsif f['disable'].nil? + ftarget = calc_target(target, (f.has_key? 'target') ? f['target'].to_s : f['name'].to_s) + uri = URI::parse(Array(ftarget).join('')) + path = URI::unescape(uri.path) + if uri.scheme == 'maildir' + @feeds.push(ConfigFeed::new(f, @maildir_account, path, self)) + else + # remove leading slash from IMAP mailbox names + path = path[1..-1] if path[0,1] == '/' + @feeds.push(ConfigFeed::new(f, @imap_accounts.add_account(uri), path, self)) end end end |