@@ 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