pidgin/pidgin

Simplify cmds

2021-05-17, Arkadiy Illarionov
ca31392953ed
Simplify cmds

* add `is_right_type`, `is_right_protocol` to reduce duplication
* search in GList using `g_list_find_custom` instead of manual iterations
* reduce scope of some variables

Testing Done:
Compiled.

Reviewed at https://reviews.imfreedom.org/r/645/
For information on translating Pidgin, libpurple, and Finch, please see
our wiki page at https://developer.pidgin.im/wiki/TipsForTranslators