fix the breakage of non-MMS messages from cd6e0df

Denver Gingerich created

While maybe a bit awkward (as the conditional is left until the end of
the statement), this fix for a non-present 'media' element sure does
make for an elegant diff.

With this, the SGX works at least as well as at it did before cd6e0df
(i.e. as of d49bf12) but the MMS ("picture messaging") support added
in cd6e0df does still need some work as mentioned there.  In
particular, we need to ensure that the media is accessible to the
user, which may necessitate us bringing back mpx-catapult in some form
(it was deleted in b1aabae).

Change summary

sgx-bwmsgsv2.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

Detailed changes

sgx-bwmsgsv2.rb 🔗

@@ -920,7 +920,7 @@ class WebhookHandler < Goliath::API
 							bare_jid, media_url
 						)
 					end
-				end
+				end unless not jparams['media']
 			else
 				text = "unknown type (#{type})"\
 					" with text: " + jparams['text']