From 40f5a38aa97aee760c658365f7ad98c227300b76 Mon Sep 17 00:00:00 2001 From: Denver Gingerich Date: Fri, 2 Jun 2017 21:17:11 +0000 Subject: [PATCH] ec4342a (!12) regression fix; MMS needs multi-arg --- sgx-catapult.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sgx-catapult.rb b/sgx-catapult.rb index 410afc1352ebcf19560277ddd020bcad520cd322..d5b87fde7d380d22ff2f4d3015643098850001df 100755 --- a/sgx-catapult.rb +++ b/sgx-catapult.rb @@ -48,12 +48,12 @@ end class SGXClient < Blather::Client def register_handler(type, *guards, &block) - super(type, *guards) { |stanza| wrap_handler(stanza, &block) } + super(type, *guards) { |*args| wrap_handler(*args, &block) } end def register_handler_before(type, *guards, &block) check_handler(type, guards) - handler = lambda { |stanza| wrap_handler(stanza, &block) } + handler = lambda { |*args| wrap_handler(*args, &block) } @handlers[type] ||= [] @handlers[type].unshift([guards, handler]) @@ -61,8 +61,8 @@ class SGXClient < Blather::Client protected - def wrap_handler(stanza, &block) - v = block.call(stanza) + def wrap_handler(*args, &block) + v = block.call(*args) v.catch(&method(:panic)) if v.is_a?(Promise) true # Do not run other handlers unless throw :pass rescue Exception => e