red010182 / pygooglevoice

Automatically exported from code.google.com/p/pygooglevoice
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

New feature request: ability to delete forever in trash folder #51

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
First, thank you for developing this.  I needed to download and delete over 400 
messages from Google Voice and your software was a great time saver.  The only 
thing I had to do manually was empty the trash folder.

I try not to permanently store messages on Google Voice for any length of time 
due to privacy issues.  Ideally I'd like to automate the process of downloading 
and permantely deleting messages from the server, similar to how POP3 works for 
e-mail.

Can you please add a message.deleteForever() function?

Original issue reported on code.google.com by sittindu...@gtempaccount.com on 3 Jan 2011 at 2:54

GoogleCodeExporter commented 9 years ago
This would be an amazing feature. Yet, for now, is it possible to delete 
messages from the trash through code? 

Original comment by Johnny.S...@gmail.com on 11 May 2011 at 6:29

GoogleCodeExporter commented 9 years ago
Add to settings.py after "DELETE = BASE + 'inbox/deleteMessages/'" :
DELETEFOREVER = BASE + 'inbox/deleteForeverMessages/'

Add to util.py after "self.folder.voice.__messages_post('delete', self.id, 
trash=trash)" :
    def deleteForever(self):
        """
        Deletes this message forever, regardless of being in the trash.  There is no undo.
        """
        self.folder.voice.__messages_post('deleteForever', self.id)

Then with any Message object, call deleteForever and it will be deleted forever.

Example:
voice.sms().messages[0].deleteForever()

Original comment by MacOS...@gmail.com on 3 Sep 2011 at 6:46

GoogleCodeExporter commented 9 years ago
 MacOS...@gmail.com thank you so much for this tip.  

I enable the deleteForever functionality in this PHP wrapper class 
class.googlevoice.php

These are the lines I added.

After this:
        return json_decode( $this->get_page( $this->urls['delete'], $params ) );
    }

Add this:
    public function deleteForever( $id )
    {
        $params = array(
            'messages' => $id,
            'trash'    => 1,
            '_rnr_se'  => $this->get_rnrse(),
        );

        return json_decode( $this->get_page( $this->urls['deleteForever'], $params ) );
    }

After this:
        'delete'    => 'https://www.google.com/voice/b/0/inbox/deleteMessages/',

Add this:

        'deleteForever'    => 'https://www.google.com/voice/b/0/inbox/deleteForeverMessages/',

The attached file already has the edits.

Original comment by sexe...@hotmail.com on 28 Mar 2014 at 8:06

Attachments: