Is it possible to disable the icon flashing on the taskbar for whispers?

Far as I can tell, it happens every time I receive a whisper. Which means that every time someone sends me a stupid guild advertisement, or a bot sends spam at me, the icon in the taskbar will flash if I’m alt tabbed.

Can I turn this off just for whispers?

Not really. It’s embedded in the ChatFrame_MessageEventHandler function that handles all the chatframe events.

While the sound played when you get a whisper has a timer restriction around how often it is played which can be manipulated somewhat, the FlashClientIcon() function is straight out called for each WHISPER/BN_WHISPER. There doesn’t seem to be a corresponding StopFlash function to create a hook with.