Fix refcounting of messages received from the network with purple3
purple3 takes the reference for the PurpleMessage passed to
purple_conversation_write_message(). The purple2 compat needs to
destroy the message. This patch removes the explicit calls to
purple_message_destroy() and changes the
purple_conversation_write_message() compat for purple2 to call
purple_message_destroy() internally.
/*
* Hangouts Plugin for libpurple/Pidgin
* Copyright (c) 2015-2016 Eion Robb, Mike Ruprecht
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
purple_notify_error(ha->pc,_("Invalid conversation"),_("This is not a valid conversation"),_("Please use the Room List to search for a valid conversation"),purple_request_cpar_from_connection(ha->pc));
}else{
purple_notify_error(ha->pc,_("Error"),_("An error occurred while fetching the history of the conversation"),NULL,purple_request_cpar_from_connection(ha->pc));
purple_notify_error(ha->pc,_("Join from URL Error"),_("Could not join group from URL"),response->response_header?response->response_header->error_description:_("Unknown Error"),purple_request_cpar_from_connection(ha->pc));
purple_notify_error(pc,_("Image Send Error"),_("There was an error sending the image"),purple_http_response_get_error(response),purple_request_cpar_from_connection(pc));
purple_notify_error(pc,_("Image Send Error"),_("There was an error sending the image"),purple_http_response_get_error(response),purple_request_cpar_from_connection(pc));