From e9249f4d994b13447769dfecf2f18e3fc27cdd4f Mon Sep 17 00:00:00 2001 From: Phillip Davis Date: Wed, 4 Feb 2026 16:17:41 -0500 Subject: [PATCH] remove inactive `case jparams['type']` branches these types do not exist in V2, which can be verified either by the reading the bandwidth docs here[0] or by reading the commit message of cd6e0df [0]: https://dev.bandwidth.com/docs/messaging/webhooks/#inbound-message-webhooks --- sgx-bwmsgsv2.rb | 33 --------------------------------- 1 file changed, 33 deletions(-) diff --git a/sgx-bwmsgsv2.rb b/sgx-bwmsgsv2.rb index 40f987e49c26e6ac50f8d646611290bcb899b33d..6a8e9b45c2dd85fa723d270ed135bce7e78b5d1c 100755 --- a/sgx-bwmsgsv2.rb +++ b/sgx-bwmsgsv2.rb @@ -1042,38 +1042,6 @@ class WebhookHandler < Goliath::API when 'in' text = '' case type - when 'sms' - text = jparams['text'] - when 'mms' - has_media = false - - if jparams['text'].empty? - if not has_media - text = '[suspected group msg '\ - 'with no text (odd)]' - end - else - text = if has_media - # TODO: write/use a caption XEP - jparams['text'] - else - '[suspected group msg '\ - '(recipient list not '\ - 'available) with '\ - 'following text] ' + - jparams['text'] - end - end - - # ie. if text param non-empty or had no media - if not text.empty? - msg = Blather::Stanza::Message.new( - bare_jid, text) - msg.from = others_num + '@' + ARGV[0] - SGXbwmsgsv2.write(msg) - end - - return [200, {}, "OK"] when 'message-received' # TODO: handle group chat, and fix above text = jparams['text'] @@ -1114,7 +1082,6 @@ class WebhookHandler < Goliath::API unless media_url.end_with?( '.smil', '.txt', '.xml' ) - has_media = true SGXbwmsgsv2.send_media( others_num + '@' + ARGV[0],