For 13.04:
The migration of Pidgin to the new libmessaging-menu API, which caused this issue, is now done for Pidgin, but still under testing. Also, only a Ubuntu 13.04 package is provided so far, but since it does not introduce any dependencies on other stuff from 13.04, I was able to just install it from the PPA of the programmer who fixed it. According to his instructions, this is what fixed it for me:
sudo add-apt-repository ppa:jconti/gnome3
sudo apt-get update
sudo apt-get install pidgin-libnotify
You should now have pidgin-libnotify version 0.14-9ubuntu1. In addition, you have to add the following line to /usr/share/applications/pidgin.desktop
:
X-MessagingMenu-UsesChatSection=true
Then restart Pidgin, it should now get an entry in the message indicator menu of the panel again, so that when closing its window, it stays running.
Update
It is NOT necessary (any more) to install this repository as of May 23. Probably the updates have been officially included by now.
Just make sure the libnotify plugin is active! With Ubuntu 12.10 (and previous) and the whitelist for system tray icons you/the user may have deactivated the libnotify plugin on purpose.
$ gsettings set com.canonical.Unity.Panel systray-whitelist "['all']"
No such schema 'com.canonical.Unity.Panel'