From 713e22bd3670d9793a896d379dfa40314d346410 Mon Sep 17 00:00:00 2001 From: Amolith Date: Mon, 23 Mar 2026 15:23:10 -0600 Subject: [PATCH] Omit incoming body instead of emitting empty string Use same body_text abstraction in both event emitting and stanza sending code --- lib/event_emitter.rb | 2 +- lib/incoming_mms.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/event_emitter.rb b/lib/event_emitter.rb index d55837b4e24a59d12af8b2ac921780b6db90fff9..96b1e277d139b341a96e57851bed894f3423d363 100644 --- a/lib/event_emitter.rb +++ b/lib/event_emitter.rb @@ -23,7 +23,7 @@ module EventEmitter ) jid_to_owner(owner_jid) { |(tel, *)| MessageEvent::In.new( - owner: tel, from: from, to: [tel], body: body.to_s, + owner: tel, from: from, to: [tel], body: body, endstream_id: endstream_id, media_urls: media_urls ).emit(REDIS) }.catch do |e| diff --git a/lib/incoming_mms.rb b/lib/incoming_mms.rb index 77d4b05b94f2a3a0059f7e23761f6139f9285993..23f60328d8d8971e7a6a747e13f252210b83c349 100644 --- a/lib/incoming_mms.rb +++ b/lib/incoming_mms.rb @@ -37,7 +37,7 @@ class IncomingMMS # MMS text parts are separate fetched .txt files; join with paragraph breaks def body_text - @txt.empty? ? "" : @txt.join("\n\n") + @txt.empty? ? nil : @txt.join("\n\n") end def media_urls @@ -64,7 +64,7 @@ class IncomingMMS def to_stanza Blather::Stanza::Message.new( addresses ? unproxied_to.domain : unproxied_to, - @txt.empty? ? nil : @txt.join("\n\n") + body_text ).tap do |m| oobs.each { |oob| m << oob } m << addresses if addresses