Kopete plugin, which allows to ignore spam messages by using simple by using simple answer/question scheme:
Potential spammers receive a simple question, and they are ignored until they answers question. After they answers correctly, they receive notification, and your chat window opens. Also, you can skip test for some contacts, matched by wildcards, specified by configuration dialog.