summaryrefslogtreecommitdiff
path: root/finch/gntblist.c
diff options
context:
space:
mode:
authorElliott Sales de Andrade <qulogic@pidgin.im>2019-10-02 02:29:06 -0400
committerElliott Sales de Andrade <qulogic@pidgin.im>2019-10-02 02:29:06 -0400
commit048e6a24c4f66506637db2bd19f1a19e97547eb1 (patch)
tree815c2329a553571a692a7aab58d9a23647214be8 /finch/gntblist.c
parent0812102636fd58ca90517858fa12b766650fe132 (diff)
downloadpidgin-048e6a24c4f66506637db2bd19f1a19e97547eb1.tar.gz
finch: Remove redundant checks.
Diffstat (limited to 'finch/gntblist.c')
-rw-r--r--finch/gntblist.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/finch/gntblist.c b/finch/gntblist.c
index 55289b5618..178ef23e65 100644
--- a/finch/gntblist.c
+++ b/finch/gntblist.c
@@ -234,10 +234,6 @@ static gboolean default_create_tooltip(gpointer selected_row, GString **body, ch
int lastseen = 0;
char *title;
- if (!node || !(PURPLE_IS_BUDDY(node) || PURPLE_IS_CONTACT(node) ||
- PURPLE_IS_GROUP(node) || PURPLE_IS_CHAT(node)))
- return FALSE;
-
str = g_string_new("");
if (PURPLE_IS_CONTACT(node)) {
@@ -958,8 +954,9 @@ append_proto_menu(GntMenu *menu, PurpleConnection *gc, PurpleBlistNode *node)
GList *list;
PurpleProtocol *protocol = purple_connection_get_protocol(gc);
- if(!protocol || !PURPLE_PROTOCOL_IMPLEMENTS(protocol, CLIENT, blist_node_menu))
+ if (!PURPLE_PROTOCOL_IMPLEMENTS(protocol, CLIENT, blist_node_menu)) {
return;
+ }
for(list = purple_protocol_client_iface_blist_node_menu(protocol, node); list;
list = g_list_delete_link(list, list))
@@ -1455,19 +1452,18 @@ finch_blist_place_tagged(PurpleBlistNode *target)
PurpleGroup *tg = NULL;
PurpleContact *tc = NULL;
- if (target == NULL || !(PURPLE_IS_BUDDY(target) || PURPLE_IS_CONTACT(target) ||
- PURPLE_IS_GROUP(target) || PURPLE_IS_CHAT(target)))
- return;
-
if (PURPLE_IS_GROUP(target))
tg = (PurpleGroup*)target;
else if (PURPLE_IS_BUDDY(target)) {
tc = (PurpleContact*)purple_blist_node_get_parent(target);
tg = (PurpleGroup*)purple_blist_node_get_parent((PurpleBlistNode*)tc);
- } else {
- if (PURPLE_IS_CONTACT(target))
- tc = (PurpleContact*)target;
+ } else if (PURPLE_IS_CONTACT(target)) {
+ tc = (PurpleContact *)target;
+ tg = (PurpleGroup *)purple_blist_node_get_parent(target);
+ } else if (PURPLE_IS_CHAT(target)) {
tg = (PurpleGroup*)purple_blist_node_get_parent(target);
+ } else {
+ return;
}
if (ggblist->tagged) {