Project

General

Profile

« Previous | Next » 

Revision 7d493229

Added by Marc Dequènes over 13 years ago

  • ID 7d4932290d4420bd471ed3d11e8b875568e3f418

[evol] add system/user notif to bot level and detecte when a conversation is idle, to close it after used in connect_peer() with block

View differences:

lib/cyborghood/cyborg.rb
include I18nTranslation
bindtextdomain("cyborghood", {:path => Config::L10N_DIR, :charset => "UTF-8"})
attr_reader :name
attr_reader :name, :system_notification, :user_notification
def initialize
@name = self.class.name.split("::").last
......
end
def setup
@system_notification = EventMachine::Channel.new
@user_notification = EventMachine::Channel.new
@system_notification_processing = @system_notification.subscribe do |msg|
process_system_notification(msg)
end
end
def run
......
protected
def process_system_notification(msg)
end
def try_stop
if ready_to_stop?
EventMachine.stop_event_loop

Also available in: Unified diff