From b4c57499f79b2bb4cfa5f4c22b438148847bf599 Mon Sep 17 00:00:00 2001 From: Stephen Paul Weber Date: Sat, 4 Mar 2017 16:49:17 -0500 Subject: [PATCH] Should not crash if id or resource missing Since id is not strictly required on messages, and bare JIDs can certainly send message stanzas. --- sgx-catapult.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sgx-catapult.rb b/sgx-catapult.rb index 2a3d99bd337a0d616fa513c5b4e906346afdded1..ac5ab3f58a3723fb9741fa7bbd65662995efe270 100755 --- a/sgx-catapult.rb +++ b/sgx-catapult.rb @@ -175,9 +175,9 @@ module SGXcatapult 'text' => m.body, 'tag' => # callbacks need both the id and resourcepart - WEBrick::HTTPUtils.escape(m.id) + ' ' + + WEBrick::HTTPUtils.escape(m.id.to_s) + ' ' + WEBrick::HTTPUtils.escape( - m.from.to_s.split('/', 2)[1] + m.from.to_s.split('/', 2)[1].to_s ), 'receiptRequested' => 'all', 'callbackUrl' => ARGV[6]