Revision 3d653143
Added by Marc Dequènes over 13 years ago
- ID 3d6531438e6a06725813d9635002e83d9b0e6444
lib/cyborghood/cyborg/conversation.rb | ||
---|---|---|
class ConversationThread
|
||
attr_reader :conversation, :name, :id, :session
|
||
|
||
def initialized(conversation, id, name)
|
||
def initialize(conversation, id, name)
|
||
@conversation = conversation
|
||
@name = name
|
||
@id = id
|
||
... | ... | |
|
||
attr_reader :conv_thread, :action_code, :action_parameters, :action_id
|
||
|
||
def initialized(conv_thread, action_code, action_parameters = nil, action_id = nil)
|
||
def initialize(conv_thread, action_code, action_parameters = nil, action_id = nil)
|
||
@conv_thread = conv_thread
|
||
@action_code = action_code
|
||
@action_parameters = action_parameters
|
||
... | ... | |
MAXIMUM_ERROR_COUNT = 3
|
||
MAXIMUM_LINES = 1024
|
||
|
||
attr_reader :interface
|
||
attr_reader :bot
|
||
|
||
def initialize(interface)
|
||
@interface = interface
|
||
def initialize(bot)
|
||
@bot = bot
|
||
|
||
super
|
||
|
||
... | ... | |
|
||
def unbind
|
||
logger.debug "Conversation finished with #{identifier}"
|
||
@bot.register_communication @peer_id unless @peer_id.nil?
|
||
@conv_threads.each_values {|s| s.close }
|
||
end
|
||
|
||
def bye
|
||
send_quit_leaving
|
||
end
|
||
|
||
def set_peer_info(id, capabilities)
|
||
@peer_id = id
|
||
@peer_capabilities = capabilities || []
|
||
@bot.register_communication @peer_id, self
|
||
end
|
||
|
||
def set_error_status(fatal = false)
|
Also available in: Unified diff
[evol] conversation/bot protocol rework §5 (refs #30)