@@ -104,7 +104,7 @@ module SGXbwmsgsv2
client.register_handler_before(type, *guards, &block)
end
- def self.send_media(from, to, media_url, desc=nil, subject=nil)
+ def self.send_media(from, to, media_url, desc=nil, subject=nil, m=nil)
# we assume media_url is of the form (always the case so far):
# https://messaging.bandwidth.com/api/v2/users/[u]/media/[path]
@@ -117,6 +117,10 @@ 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.body = proxy_url
+ end
msg.from = from
msg.subject = subject if subject
@@ -917,7 +921,8 @@ class WebhookHandler < Goliath::API
SGXbwmsgsv2.send_media(
others_num + '@' +
ARGV[0],
- bare_jid, media_url
+ bare_jid, media_url,
+ nil, nil, msg.copy
)
end
end unless not jparams['media']