TwilioDevEd / message-segment-calculator

JS-based tool to calculate and display message segmentation data for a given message body
https://twiliodeved.github.io/message-segment-calculator/
MIT License
85 stars 35 forks source link

Support Segment Calculation for MMS #25

Closed comphonia closed 2 years ago

comphonia commented 2 years ago

Is it possible to support MMS segments calculation? constructor(message, encoding, type) type = "sms" | "mms"

ajhenry commented 1 year ago

Hi @comphonia, how did you solve this problem?

comphonia commented 1 year ago

Hi @comphonia, how did you solve this problem?

Hey, I just used an adapter to force the segment count to 1 for MMS. This makes sense if you use the count as a cost multiplier and you limit the input to a max 1600 characters

const stats = new SegmentedMessage(<<msg>>)
if(attachments.length) stats.numberOfCharacters = 1
return stats
ajhenry commented 1 year ago

Awesome! Thanks so much