Skip to content
This repository has been archived by the owner on Mar 4, 2021. It is now read-only.

SMS/MMS Display Attached Media #342 #343

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jpwalters
Copy link
Contributor

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

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 attach media and either renders or provides a link to download

Note: Renders images, audio and video content.
New Feature:
Added the text 'mms' to indicate a multiple media message so that the user has some indication that were are media attachments to the message and therefore needs to click the message to view the attached media.
@jpwalters
Copy link
Contributor Author

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

@@ -124,6 +124,43 @@
<h3>Transcription</h3>
<?php endif; ?>
<div class="message-transcript"><?php echo (is_null($message->content_text) ? "(no transcription)" : $message->content_text) ?></div>
<?php if(substr($message->call_sid,0,2) == 'MM'):
echo "<br><br><h3>Media Attachements</h3>";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't control spacing with <br>. This is what css is for.

@Gipetto
Copy link
Contributor

Gipetto commented Oct 5, 2015

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.

@bkonia
Copy link

bkonia commented Apr 29, 2016

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

@jpwalters
Copy link
Contributor Author

@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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants