diff --git a/sgx_jmp.rb b/sgx_jmp.rb index 9614ab4bed305244e9da00bb965eb8acc1a986b0..12847799d07c30e86ff6ea8f52cd4cd6d495e092 100644 --- a/sgx_jmp.rb +++ b/sgx_jmp.rb @@ -259,7 +259,7 @@ message( from: /(\A|@)#{CONFIG[:sgx]}(\/|\Z)/ ) do |m| StatsD.increment("inbound_group_text") - sentry_hub = new_sentry_hub(m, name: "message") + sentry_hub = new_sentry_hub(m, name: "inbound_group_text") address = m.find("ns:addresses", ns: ADDRESSES_NS).first &.find("ns:address", ns: ADDRESSES_NS) @@ -272,7 +272,7 @@ message( address["jid"] = customer.jid.to_s BLATHER << m }.catch_only(CustomerRepo::NotFound) { |e| - BLATHER << iq.as_error("forbidden", :auth, e.message) + BLATHER << m.as_error("forbidden", :auth, e.message) }.catch { |e| panic(e, sentry_hub) } end @@ -304,13 +304,13 @@ message do |m| ExpiringLock.new("jmp_usage_notify-#{customer.customer_id}").with do BLATHER.join(CONFIG[:notify_admin], "sgx-jmp") BLATHER.say( - CONFIG[:notify_admin], - "#{customer.customer_id} has used #{usage} " \ - "messages since #{today - 30}", - :groupchat + CONFIG[:notify_admin], "#{customer.customer_id} has used #{usage} " \ + "messages since #{today - 30}", :groupchat ) end end + }.catch_only(CustomerRepo::NotFound) { |e| + BLATHER << m.as_error("forbidden", :auth, e.message) }.catch { |e| panic(e, sentry_hub) } end