~singpolyma/sgx-jmp

0693d5a58af0cf98a2316040f48f39cdf060e856 — Stephen Paul Weber 1 year, 1 month ago e97ecf1
No tel picker yet, so just go to the webpage

Direct users to the homepage if they haven't selected a tel yet.  Not what we
want eventually, but better than crashing.
2 files changed, 11 insertions(+), 3 deletions(-)

M lib/web_register_manager.rb
M sgx_jmp.rb
M lib/web_register_manager.rb => lib/web_register_manager.rb +8 -2
@@ 28,8 28,14 @@ class WebRegisterManager
	end

	class ChooseTel
		def choose_tel(_iq)
			raise "TODO"
		def choose_tel(iq)
			reply = iq.reply
			reply.status = :completed
			reply.note_type = :info
			reply.note_text =
				"You have not chosen a phone number yet, please return to " \
				"https://jmp.chat and choose one now."
			EMPromise.reject(reply)
		end
	end
end

M sgx_jmp.rb => sgx_jmp.rb +3 -1
@@ 100,7 100,7 @@ def panic(e, hub=nil)
	if e.is_a?(::Exception)
		(hub || Sentry).capture_exception(e, hint: { background: false })
	else
		(hub || Sentry).capture_message(e, hint: { background: false })
		(hub || Sentry).capture_message(e.to_s, hint: { background: false })
	end
	exit 1
end


@@ 290,6 290,8 @@ command :execute?, node: "jabber:iq:register", sessionid: nil do |iq|
			customer,
			web_register_manager
		).then(&:write)
	}.catch_only(Blather::Stanza) { |reply|
		self << reply
	}.catch { |e| panic(e, sentry_hub) }
end