From fcb7e2c3c4c68f6c775489e59f1924e4d345cb85 Mon Sep 17 00:00:00 2001 From: Denver Gingerich Date: Sun, 3 May 2020 21:47:43 +0000 Subject: [PATCH] put .copy() in send_media - caller shouldn't worry We added group picture message receiving support in d89a1b7, but the API introduced there (as part of the send_media method) was not ideal due to the caller having to worry about the deep clone. So instead we will move the .copy() into send_media() so that it worries about the deep clone and the caller doesn't have to care. --- sgx-bwmsgsv2.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sgx-bwmsgsv2.rb b/sgx-bwmsgsv2.rb index bfee7176214aba2b04236129e4a88394525055b1..7552eb108b87e1f0a2a430c65f36dd21c8b6de9a 100755 --- a/sgx-bwmsgsv2.rb +++ b/sgx-bwmsgsv2.rb @@ -118,7 +118,7 @@ module SGXbwmsgsv2 # put URL in the body (so Conversations will still see it)... msg = Blather::Stanza::Message.new(to, proxy_url) if m - msg = m + msg = m.copy msg.body = proxy_url end msg.from = from @@ -928,7 +928,7 @@ class WebhookHandler < Goliath::API others_num + '@' + ARGV[0], bare_jid, media_url, - nil, nil, msg.copy + nil, nil, msg ) end end unless not jparams['media']