diff --git a/sgx_endstream.rb b/sgx_endstream.rb index 5a1543ae205bece9a5eb9c18e1285dcc667d844b..434209bd36b565c4f7759b4a2a8cd89fa9139666 100755 --- a/sgx_endstream.rb +++ b/sgx_endstream.rb @@ -219,14 +219,20 @@ message from: /@mms.chat.1pcom.net\Z/ do |m| end IncomingMMS.for(m.to, json).then { |incoming| + tel = if m.from.node.length > 7 + "+#{m.from.node}" + else + "#{m.from.node};phone-context=ca-us.phone-context.soprani.ca" + end + to_send = incoming.to_stanza to_send.id = m.id - to_send.from = Blather::JID.new("+#{m.from.node}", CONFIG[:component][:jid]) + to_send.from = Blather::JID.new(tel, CONFIG[:component][:jid]) self << to_send emit_incoming_event( incoming.unproxied_to, - from: "+#{m.from.node}", + from: tel, body: incoming.body_text, endstream_id: m.id, media_urls: incoming.media_urls