--- a/libpurple/protocols/ircv3/meson.build Wed Nov 16 22:28:10 2022 -0600
+++ b/libpurple/protocols/ircv3/meson.build Wed Nov 16 22:31:08 2022 -0600
@@ -1,14 +1,19 @@
'purpleircv3connection.c',
+ 'purpleircv3messagehandlers.c', + 'purpleircv3protocol.c', + 'purpleircv3protocolim.c', 'purpleircv3connection.h',
- 'purpleircv3messagehandlers.c',
'purpleircv3messagehandlers.h',
- 'purpleircv3protocol.c',
+ 'purpleircv3protocolim.h', @@ -18,7 +23,7 @@
IRCV3_SOURCES += ircv3_resources
- ircv3_prpl = shared_library('ircv3', IRCV3_SOURCES,
+ ircv3_prpl = shared_library('ircv3', IRCV3_SOURCES + IRCV3_HEADERS, c_args : ['-DG_LOG_USE_STRUCTURED', '-DG_LOG_DOMAIN="Purple-IRCv3"'],
dependencies : [sasl, libpurple_dep, glib, gio, ws2_32],
install : true, install_dir : PURPLE_PLUGINDIR)
--- a/libpurple/protocols/ircv3/purpleircv3messagehandlers.c Wed Nov 16 22:28:10 2022 -0600
+++ b/libpurple/protocols/ircv3/purpleircv3messagehandlers.c Wed Nov 16 22:31:08 2022 -0600
@@ -180,7 +180,7 @@
conversation = purple_chat_conversation_new(account, target);
- conversation = purple_im_conversation_new(account, target);
+ conversation = purple_im_conversation_new(account, source); purple_conversation_manager_register(conversation_manager,
--- a/libpurple/protocols/ircv3/purpleircv3protocol.c Wed Nov 16 22:28:10 2022 -0600
+++ b/libpurple/protocols/ircv3/purpleircv3protocol.c Wed Nov 16 22:31:08 2022 -0600
@@ -22,6 +22,7 @@
#include "purpleircv3connection.h"
#include "purpleircv3core.h"
+#include "purpleircv3protocolim.h" /******************************************************************************
* PurpleProtocol Implementation
@@ -137,8 +138,13 @@
/******************************************************************************
*****************************************************************************/
-G_DEFINE_DYNAMIC_TYPE(PurpleIRCv3Protocol, purple_ircv3_protocol,
+G_DEFINE_DYNAMIC_TYPE_EXTENDED( + G_IMPLEMENT_INTERFACE_DYNAMIC(PURPLE_TYPE_PROTOCOL_IM, + purple_ircv3_protocol_im_init)) purple_ircv3_protocol_init(PurpleIRCv3Protocol *protocol) {
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/libpurple/protocols/ircv3/purpleircv3protocolim.c Wed Nov 16 22:31:08 2022 -0600
@@ -0,0 +1,49 @@
+ * Purple - Internet Messaging Library + * Copyright (C) Pidgin Developers <devel@pidgin.im> + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * This library 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 + * Lesser General Public License for more details. + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, see <https://www.gnu.org/licenses/>. +#include <glib/gi18n-lib.h> +#include "purpleircv3protocolim.h" +#include "purpleircv3connection.h" +/****************************************************************************** + * PurpleProtocolIM Implementation + *****************************************************************************/ +purple_ircv3_protocol_send_im(PurpleProtocolIM *im, + PurpleConnection *conn, + PurpleMessage *message) + PurpleIRCv3Connection *connection = PURPLE_IRCV3_CONNECTION(conn); + const char *contents = NULL; + const char *recipient = NULL; + contents = purple_message_get_contents(message); + recipient = purple_message_get_recipient(message); + purple_ircv3_connection_writef(connection, "PRIVMSG %s :%s", recipient, +purple_ircv3_protocol_im_init(PurpleProtocolIMInterface *iface) { + iface->send = purple_ircv3_protocol_send_im; --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/libpurple/protocols/ircv3/purpleircv3protocolim.h Wed Nov 16 22:31:08 2022 -0600
@@ -0,0 +1,28 @@
+ * Purple - Internet Messaging Library + * Copyright (C) Pidgin Developers <devel@pidgin.im> + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * This library 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 + * Lesser General Public License for more details. + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, see <https://www.gnu.org/licenses/>. +#ifndef PURPLE_IRCV3_PROTOCOL_IM_H +#define PURPLE_IRCV3_PROTOCOL_IM_H +G_GNUC_INTERNAL void purple_ircv3_protocol_im_init(PurpleProtocolIMInterface *iface); +#endif /* PURPLE_IRCV3_PROTOCOL_IM_H */