* 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/
PidginandFinch:ThePimpin' Penguin IM Clients That'reGoodfortheSoul