* 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/
# Biełaruski pierakład Pidgin
# Copyright (C) 2007 THE pidgin'S COPYRIGHT HOLDER
# This file is distributed under the same license as the pidgin package.