twilio / OpenVBX

OpenVBX is a web-based open source phone system for business.
http://openvbx.org
Other
699 stars 342 forks source link

SMS/MMS Display Attached Media #342 #343

Open jpwalters opened 8 years ago

jpwalters commented 8 years ago

Feature Enhancement:

Note: Renders images, audio and video content.

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

jpwalters commented 8 years ago

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

Gipetto commented 8 years ago

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 commented 8 years ago

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

jpwalters commented 8 years ago

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