Wednesday, December 08, 2010

Cancelling pending messages in Skype

How often are you chatting with someone in text on Skype when they log off, leaving messages in a send queue "waiting to be delivered"? How often does this happen, and the other party doesn't log on at the same time as you for days or weeks?

Well, it happens to me now and again. Sometimes you'll check the chat window with someone and see that it's waiting to send "Hey, I'll be a bit late this evening, maybe 9pm?", a month after the event? In many cases, you'd rather cancel the message rather than possibly confuse them when they receive it weeks later out of the blue.

Unfortunately, for some inexplicably stupid reason (or, more likely, no reason), Skype does not provide any method to cancel messages that are waiting to be sent, even though they're merely held offline on your local machine until Skype sees the other party online again. There is no technical reason whatsoever why these messages can't be deleted.

Since Skype doesn't do the job, you'll have to do it yourself. And luckily, it's not too difficult - it just requires one SQL statement to be executed on your local Skype database:

download a sqllite editor (http://sourceforge.net/projects/sqlitebrowser/)
exit skype
browse to: %AppData%\Skype
browse into your username directory
backup main.db <--- IMPORTANT!!!
run the sqllite editor
open main.db in sqllite editor
in the Execute SQL tab type the following commands:

--> (optional) this command will show you all of your unsent messages:
select author,identities,dialog_partner,body_xml from messages where sending_status = 1

--> this command will delete all unsent messages to a specific username:
delete from messages where dialog_partner = "username" and sending_status = 1

--> this command will delete all unsent messages:
delete from messages where sending_status = 1