Sat, 23 Jan 2021 20:28:06 -0600
Remove some unnecessary NULL checks.
* When removing a buddy, the group is optional as noted in the description.
* When setting a buddy icon, the icon may be %NULL to remove existing icons.
Testing Done:
Compile and watch for assertion failures in the log, when signing out of Bonjour, and when removing a buddy icon from an account (which did nothing.)
Reviewed at https://reviews.imfreedom.org/r/445/
| libpurple/purpleprotocolserver.c | file | annotate | diff | comparison | revisions | |
| libpurple/purpleprotocolserver.h | file | annotate | diff | comparison | revisions |
--- a/libpurple/purpleprotocolserver.c Sat Jan 23 20:26:48 2021 -0600 +++ b/libpurple/purpleprotocolserver.c Sat Jan 23 20:28:06 2021 -0600 @@ -206,7 +206,6 @@ g_return_if_fail(PURPLE_IS_PROTOCOL_SERVER(protocol_server)); g_return_if_fail(PURPLE_IS_CONNECTION(connection)); g_return_if_fail(PURPLE_IS_BUDDY(buddy)); - g_return_if_fail(PURPLE_IS_GROUP(group)); iface = PURPLE_PROTOCOL_SERVER_GET_IFACE(protocol_server); if(iface != NULL && iface->remove_buddy != NULL) { @@ -333,7 +332,6 @@ g_return_if_fail(PURPLE_IS_PROTOCOL_SERVER(protocol_server)); g_return_if_fail(PURPLE_IS_CONNECTION(connection)); - g_return_if_fail(PURPLE_IS_IMAGE(img)); iface = PURPLE_PROTOCOL_SERVER_GET_IFACE(protocol_server); if(iface != NULL && iface->set_buddy_icon != NULL) {
--- a/libpurple/purpleprotocolserver.h Sat Jan 23 20:26:48 2021 -0600 +++ b/libpurple/purpleprotocolserver.h Sat Jan 23 20:28:06 2021 -0600 @@ -274,7 +274,7 @@ * @protocol_server: The #PurpleProtocolServer instance. * @connection: The #PurpleConnection instance. * @buddy: The #PurpleBuddy instance. - * @group: The #PurpleGroup instance. + * @group: (nullable): The #PurpleGroup instance. * * Removes @buddy and potentially @group from the server side list of contacts. * @@ -372,7 +372,7 @@ * purple_protocol_server_set_buddy_icon: * @protocol_server: The #PurpleProtocolServer instance. * @connection: The #PurpleConnection instance. - * @img: The #PurpleImage instance. + * @img: (nullable): The #PurpleImage instance, or %NULL to unset the icon. * * Sets the user's buddy icon to @img. *