OpenVBX icon indicating copy to clipboard operation
OpenVBX copied to clipboard

SMS/MMS Display Attached Media #342

Open jpwalters opened this issue 10 years ago • 4 comments

Feature Enhancement:

  • Checks to see if the first 2 characters of th Sid are MM
  • If the messages is a MMS message it then iterates through the attached media and either renders or provides a link to download

Note: Renders images, audio and video content.

Screenshot of an MP3 audio attachment. sms-details-view-mp3

jpwalters avatar Oct 04 '15 05:10 jpwalters

Inbox Feature Enhancement:

I've added a simple 'mms' text indicator to the message line on the inbox page so that the user has an indication that media is attached so the SMS message they received. Hopefully that will be enough an of an indication so that they click the message to view the details and see the attached media.

Screenshot: inbox-mms-indicator

jpwalters avatar Oct 04 '15 20:10 jpwalters

This is cool. I'm glad that this might actually get done. MMS has been a sore thumb in OpenVBX for a long while now. It would be great to be able to show the media on messages.

Gipetto avatar Oct 05 '15 05:10 Gipetto

When a user deletes an MMS in OpenVBX, will this automatically delete any associated media from Twilio? If not, it should.

bkonia avatar Apr 29 '16 00:04 bkonia

@bkonia, good question. Currently when you delete a record from OpenVBX all that happens is a "soft delete" (or archive as OpenVBX calls it) from the local database. OpenVBX does not actually delete the message or its associated media from your twilio account.

Store Note: Its also worth mentioning that incoming mms messages are NOT stored on your local server but rather they are stored by twilio.com and linked to your twilio.com account.

Link to Code File

Here's the code snippet of what happens when you delete a message.

function archive($message_id, $user_id, $archived)
    {
        $message = $this->get_message($message_id);
        $archived = boolean($archived);
        if(intval($message->archived) === $archived)
        {
            return false;
        }

        $message->archived = $archived;

        try
        {
            $this->save($message);
            $action = $message->archived? 'Archived' : 'Restored';
            $annotation_id = $this->vbx_message->annotate($message_id,
                                                          $user_id,
                                                          "$action message",
                                                          'archived');
        }
        catch(VBX_MessageException $e)
        {
            throw $e;
        }

    }

Deleting wasn't a part of this pull request but could be a good enhancement to OpenVBX if you want to add it to the issue list.

jpwalters avatar Apr 29 '16 04:04 jpwalters