# HG changeset patch # User Mark Doliner # Date 1253599268 0 # Node ID dab0d17dc6c13cb50ee38271b0ef28a991f7ecd6 # Parent 7983230cc1c033f7bba908be0ad937b8c58a51cd Minor cleanup. gc->prpl is guarranteed to be a PurplePlugin with type PURPLE_PLUGIN_PROTOCOL diff -r 7983230cc1c0 -r dab0d17dc6c1 libpurple/connection.c --- a/libpurple/connection.c Tue Sep 22 02:12:42 2009 +0000 +++ b/libpurple/connection.c Tue Sep 22 06:01:08 2009 +0000 @@ -52,10 +52,7 @@ send_keepalive(gpointer data) { PurpleConnection *gc = data; - PurplePluginProtocolInfo *prpl_info = NULL; - - if (gc == NULL) - return TRUE; + PurplePluginProtocolInfo *prpl_info; /* Only send keep-alives if we haven't heard from the * server in a while. @@ -63,12 +60,8 @@ if ((time(NULL) - gc->last_received) < KEEPALIVE_INTERVAL) return TRUE; - if (gc->prpl == NULL) - return TRUE; - prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(gc->prpl); - - if (prpl_info && prpl_info->keepalive) + if (prpl_info->keepalive) prpl_info->keepalive(gc); return TRUE; diff -r 7983230cc1c0 -r dab0d17dc6c1 libpurple/server.c --- a/libpurple/server.c Tue Sep 22 02:12:42 2009 +0000 +++ b/libpurple/server.c Tue Sep 22 06:01:08 2009 +0000 @@ -142,7 +142,7 @@ conv = purple_find_conversation_with_account(PURPLE_CONV_TYPE_IM, name, account); - if(prpl_info && prpl_info->send_im) + if (prpl_info->send_im) val = prpl_info->send_im(gc, name, message, flags); /* @@ -176,7 +176,7 @@ if(prpl) prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl); - if(gc && prpl_info && prpl_info->get_info) + if (prpl_info && prpl_info->get_info) prpl_info->get_info(gc, name); } @@ -229,7 +229,7 @@ if(prpl) prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl); - if(b && prpl_info && prpl_info->alias_buddy) { + if (prpl_info && prpl_info->alias_buddy) { prpl_info->alias_buddy(gc, purple_buddy_get_name(b), purple_buddy_get_local_buddy_alias(b)); } } @@ -367,12 +367,10 @@ if(prpl) prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl); - if(gc && og && ng) { - if (prpl_info && prpl_info->group_buddy) { - prpl_info->group_buddy(gc, purple_buddy_get_name(b), - purple_group_get_name(og), - purple_group_get_name(ng)); - } + if (prpl_info && prpl_info->group_buddy) { + prpl_info->group_buddy(gc, purple_buddy_get_name(b), + purple_group_get_name(og), + purple_group_get_name(ng)); } } diff -r 7983230cc1c0 -r dab0d17dc6c1 libpurple/util.c --- a/libpurple/util.c Tue Sep 22 02:12:42 2009 +0000 +++ b/libpurple/util.c Tue Sep 22 06:01:08 2009 +0000 @@ -3140,7 +3140,7 @@ { PurplePluginProtocolInfo *prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl); - if(prpl_info && prpl_info->normalize) + if (prpl_info->normalize) ret = prpl_info->normalize(account, str); } }