Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to delete chat history for only one contact in Linux. I've tried sqlite:

http://www.sqlite.org/download.html

but it removes chat conversation for a while and after restart skype it returns them back. Is there a way to delete chat for a definite person? Thanks.

share|improve this question
up vote 5 down vote accepted

You may do it with sqliteman.

You can install sqliteman from the Ubuntu Software Centre.

First, not just close but really quit Skype (right click on the Skype icon in the Unity panel and select quit).

Now make a backup of the Skype sqlite database. With your favorite file manager go to $HOME/.skype/YOUR-SYKPE-NAME/ and duplicate the main.db file.

Start sqliteman and open the file $HOME/.skype/YOUR-SYKPE-NAME/main.db You may need enable displaying of hidden files: Do a right click in the file chooser somewhere in the filelist and check "display hidden files".

When opened, on the right site at the top you see the SQL Editor. Run the following SQL-commands, one by one by clicking the single green arrow at the top. After each run clear the SQL-Editor and paste/edit the next one.

Replace SKYPE_NAME with the real Skype name of the Skype partner, not with an alias name!

DELETE FROM messages WHERE
 dialog_partner="SKYPE_NAME" OR
 chatname LIKE "%/$SKYPE_NAME;%" OR
 chatname LIKE "#SKYPE_NAME/$%"
DELETE FROM chats WHERE
 dialog_partner="SKYPE_NAME" OR
 name LIKE "%/$SKYPE_NAME;%" OR
 name LIKE "#SKYPE_NAME/$%"
DELETE FROM chatmembers WHERE
 identity = "SKYPE_NAME" OR
 chatname LIKE "%/$SKYPE_NAME;%" OR
 chatname LIKE "#SKYPE_NAME/$%"
DELETE FROM participants WHERE identity="SKYPE_NAME"
DELETE FROM conversations WHERE
 identity LIKE "%$SKYPE_NAME;%" OR
 identity = "SKYPE_NAME" OR
 identity LIKE "#SKYPE_NAME/$%"
DELETE FROM transfers WHERE partner_handle = "SKYPE_NAME"
DELETE FROM voicemails WHERE partner_handle = "SKYPE_NAME"

Close sqliteman (if asked, you don't need to save changes of the SQL editor) and start Skype. The history of SKYPE_NAME should be gone.

share|improve this answer
    
Does it have to be one by one? Can't you just add ; after each command? – muru Mar 20 at 12:11
    
No, sqliteman dont like ; - maybe I just dont know how - but if I combine two or more commands in the SQL editor with ; and linebreaks only the last got executed. I was surprised, too. – cmks Mar 20 at 12:14
    
The screenshot on the sqliteman home page seems to indicate it doesn't mind ;. – muru Mar 20 at 12:16
    
I got it - if there is more than one statement you have to click the double-green-error - shame on me - hmmm, but if I do so, no error but the commands aren't really done, too - crazy – cmks Mar 20 at 12:21
    
It seems you need an active cursor in the right context before starting multible commands. I don't know how to achive it and I dont will explore that. It's not intuitive... – cmks Mar 20 at 12:31

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.