Use before filter to actually come before everything

Stephen Paul Weber created

Otherwise we go in hierarchy order and stanza comes last.

Change summary

sgx_jmp.rb | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

Detailed changes

sgx_jmp.rb 🔗

@@ -19,7 +19,6 @@ 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)
@@ -140,10 +139,10 @@ message to: /\Aaccount@/ do |m|
 	end
 end
 
-stanza to: /\Acustomer_/, from: /@#{CONFIG[:sgx]}(\/|\Z)/ do |s|
+before nil, to: /\Acustomer_/, from: /(\A|@)#{CONFIG[:sgx]}(\/|\Z)/ do |s|
 	sentry_hub = new_sentry_hub(s, name: "stanza_customer")
 	Customer.for_customer_id(
-		m.to.node.delete_prefix("customer_")
+		s.to.node.delete_prefix("customer_")
 	).then { |customer|
 		sentry_hub.current_scope.set_user(
 			id: customer.customer_id,
@@ -151,6 +150,7 @@ stanza to: /\Acustomer_/, from: /@#{CONFIG[:sgx]}(\/|\Z)/ do |s|
 		)
 		customer.stanza_to(s)
 	}.catch { |e| panic(e, sentry_hub) }
+	halt
 end
 
 message do |m|