New version of Pidgin has come out. This version has a cure for my problem when i left my Pidgin on my computer for a long time. Most of the time, it got disconnected randomly. The latest version, 2.5.2 has (hopefully) solved this problem by pinging once every hour. Also i experienced another bug in 2.5.1 which related to ESC key. It was supposed to close a conversation window, but sometimes, it closed the main application also. This was also fixed in 2.5.2.
So for those who still uses Pidgin 2.5.1, it's suggested that you upgrade to 2.5.2. The Changelog will give you detailed information about this release.