From edd8623f94fcf1b333fedab44dc75d43b561527f Mon Sep 17 00:00:00 2001 From: Stephen Paul Weber Date: Wed, 23 Jun 2021 09:29:07 -0500 Subject: [PATCH] Pass everything from SGX to user, not just --- sgx_jmp.rb | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/sgx_jmp.rb b/sgx_jmp.rb index 2d0760b..20bee94 100644 --- a/sgx_jmp.rb +++ b/sgx_jmp.rb @@ -19,6 +19,7 @@ CONFIG = .new(safe: Dhall::Coder::JSON_LIKE + [Symbol, Proc]) .load(ARGV[0], transform_keys: ->(k) { k&.to_sym }) +Blather::Stanza.handler_list << :stanza singleton_class.class_eval do include Blather::DSL Blather::DSL.append_features(self) @@ -139,16 +140,16 @@ message to: /\Aaccount@/ do |m| end end -message to: /\Acustomer_/, from: /@#{CONFIG[:sgx]}(\/|\Z)/ do |m| - sentry_hub = new_sentry_hub(m, name: "message_customer") +stanza to: /\Acustomer_/, from: /@#{CONFIG[:sgx]}(\/|\Z)/ do |s| + sentry_hub = new_sentry_hub(s, name: "stanza_customer") Customer.for_customer_id( m.to.node.delete_prefix("customer_") ).then { |customer| sentry_hub.current_scope.set_user( id: customer.customer_id, - jid: m.from.stripped.to_s + jid: s.from.stripped.to_s ) - customer.stanza_to(m) + customer.stanza_to(s) }.catch { |e| panic(e, sentry_hub) } end -- 2.45.2