diff -r 9ff9acf9fa14 -r 3573c82d32d8 pidgin/gtkconv.c --- a/pidgin/gtkconv.c Wed Aug 30 20:33:01 2017 -0300 +++ b/pidgin/gtkconv.c Thu Aug 31 22:40:50 2017 -0500 @@ -1679,7 +1679,7 @@ g_object_set_data_full(G_OBJECT(button), "user_data", g_strdup(who), g_free); - if (protocol && PURPLE_PROTOCOL_IMPLEMENTS(protocol, XFER_IFACE, send)) + if (protocol && PURPLE_IS_PROTOCOL_XFER(protocol)) { gboolean can_receive_file = TRUE; @@ -1693,9 +1693,11 @@ gchar *real_who = NULL; real_who = purple_protocol_chat_iface_get_user_real_name(protocol, gc, purple_chat_conversation_get_id(chat), who); - if (!(!PURPLE_PROTOCOL_IMPLEMENTS(protocol, XFER_IFACE, can_receive) || - purple_protocol_xfer_iface_can_receive(protocol, gc, real_who ? real_who : who))) + + if (!purple_protocol_xfer_can_receive(protocol, gc, real_who ? real_who : who)) { can_receive_file = FALSE; + } + g_free(real_who); } @@ -7424,12 +7426,18 @@ if (PURPLE_IS_IM_CONVERSATION(conv)) { + gboolean can_send_file = FALSE; + const gchar *name = purple_conversation_get_name(conv); + + if (PURPLE_IS_PROTOCOL_XFER(protocol) && + purple_protocol_xfer_can_receive(PURPLE_PROTOCOL_XFER(protocol), gc, name) + ) { + can_send_file = TRUE; + } + gtk_action_set_sensitive(win->menu->add, (PURPLE_PROTOCOL_IMPLEMENTS(protocol, SERVER_IFACE, add_buddy))); gtk_action_set_sensitive(win->menu->remove, (PURPLE_PROTOCOL_IMPLEMENTS(protocol, SERVER_IFACE, remove_buddy))); - gtk_action_set_sensitive(win->menu->send_file, - (PURPLE_PROTOCOL_IMPLEMENTS(protocol, XFER_IFACE, send) && - (!PURPLE_PROTOCOL_IMPLEMENTS(protocol, XFER_IFACE, can_receive) || - purple_protocol_xfer_iface_can_receive(protocol, gc, purple_conversation_get_name(conv))))); + gtk_action_set_sensitive(win->menu->send_file, can_send_file); gtk_action_set_sensitive(win->menu->get_attention, (PURPLE_PROTOCOL_IMPLEMENTS(protocol, ATTENTION_IFACE, send))); gtk_action_set_sensitive(win->menu->alias, (account != NULL) &&