Revision 58250ed9
Added by Marc Dequènes almost 14 years ago
- ID 58250ed9d4a7244e8086708851ac61b0819fd911
lib/cyborghood/imap.rb | ||
---|---|---|
@available_mails = 0
|
||
@available_mails_mutex = Mutex.new
|
||
|
||
if @config.debug.flags.include?('debug_imapverbose')
|
||
if @config.debug.flags.include?('debug_imapverbose')
|
||
Net::IMAP.debug = true
|
||
end
|
||
end
|
||
... | ... | |
|
||
def listen_to_events
|
||
@imap.add_response_handler do |resp|
|
||
logger.debug "IMAP event: " + resp.inspect if @config.debug.flags.include?('debug_imapverbose')
|
||
if resp.kind_of?(Net::IMAP::UntaggedResponse) and resp.name == "EXISTS"
|
||
@available_mails_mutex.synchronize do
|
||
@available_mails = resp.data.to_i
|
||
... | ... | |
|
||
if self.capabilities.include?("IDLE")
|
||
logger.debug "Waiting for new mails in idle mode"
|
||
@imap.idle #do |resp|
|
||
@imap.idle
|
||
sleep(1) until @stop_mail_check or waiting_mails?
|
||
@imap.idle_done
|
||
end
|
Also available in: Unified diff
[debug] more IMAP debug