--- a/libpurple/connection.c Tue Sep 20 02:24:00 2022 -0500
+++ b/libpurple/connection.c Tue Sep 20 02:43:20 2022 -0500
@@ -31,7 +31,6 @@
#include "purpleprivate.h"
#include "purpleprotocolserver.h"
-#include "purpleprotocolfactory.h"
--- a/libpurple/meson.build Tue Sep 20 02:24:00 2022 -0500
+++ b/libpurple/meson.build Tue Sep 20 02:43:20 2022 -0500
@@ -73,13 +73,13 @@
'purpleprotocolactions.c',
'purpleprotocolclient.c',
- 'purpleprotocolfactory.c',
'purpleprotocolmanager.c',
'purpleprotocolprivacy.c',
'purpleprotocolroomlist.c',
'purpleprotocolserver.c',
+ 'purpleprotocolwhiteboard.c', 'purplesqlitehistoryadapter.c',
@@ -175,13 +175,13 @@
'purpleprotocolactions.h',
'purpleprotocolclient.h',
- 'purpleprotocolfactory.h',
'purpleprotocolmanager.h',
'purpleprotocolprivacy.h',
'purpleprotocolroomlist.h',
'purpleprotocolserver.h',
+ 'purpleprotocolwhiteboard.h', 'purplesqlitehistoryadapter.h',
--- a/libpurple/purpleprotocolfactory.c Tue Sep 20 02:24:00 2022 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,56 +0,0 @@
- * Purple is the legal property of its developers, whose names are too numerous
- * to list here. Please refer to the COPYRIGHT file distributed with this
- * 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 2 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, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
-#include "purpleprotocolfactory.h"
-G_DEFINE_INTERFACE(PurpleProtocolFactory, purple_protocol_factory,
-/******************************************************************************
- * GInterface Implementation
- *****************************************************************************/
-purple_protocol_factory_default_init(PurpleProtocolFactoryInterface *iface) {
-/******************************************************************************
- *****************************************************************************/
-purple_protocol_factory_whiteboard_new(PurpleProtocolFactory *factory,
- PurpleAccount *account,
- PurpleProtocolFactoryInterface *iface = NULL;
- g_return_val_if_fail(PURPLE_IS_PROTOCOL_FACTORY(factory), NULL);
- g_return_val_if_fail(PURPLE_IS_ACCOUNT(account), NULL);
- g_return_val_if_fail(who, NULL);
- iface = PURPLE_PROTOCOL_FACTORY_GET_IFACE(factory);
- if(iface && iface->whiteboard_new) {
- return iface->whiteboard_new(factory, account, who, state);
--- a/libpurple/purpleprotocolfactory.h Tue Sep 20 02:24:00 2022 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,103 +0,0 @@
- * Purple - Internet Messaging Library
- * Copyright (C) Pidgin Developers <devel@pidgin.im>
- * Purple is the legal property of its developers, whose names are too numerous
- * to list here. Please refer to the COPYRIGHT file distributed with this
- * 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 2 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 <https://www.gnu.org/licenses/>.
-#if !defined(PURPLE_GLOBAL_HEADER_INSIDE) && !defined(PURPLE_COMPILATION)
-# error "only <purple.h> may be included directly"
-#ifndef PURPLE_PROTOCOL_FACTORY_H
-#define PURPLE_PROTOCOL_FACTORY_H
-#include <glib-object.h>
-#include <libpurple/account.h>
-#define PURPLE_TYPE_PROTOCOL_FACTORY (purple_protocol_factory_iface_get_type())
- * PurpleProtocolFactory:
- * An interface where protocols can expose subclasses of libpurple objects.
-G_DECLARE_INTERFACE(PurpleProtocolFactory, purple_protocol_factory, PURPLE,
- PROTOCOL_FACTORY, PurpleProtocol)
- * PurpleProtocolFactoryInterface:
- * @connection_new: Creates a new protocol-specific connection object that
- * subclasses #PurpleConnection.
- * @roomlist_new: Creates a new protocol-specific room list object that
- * subclasses #PurpleRoomlist.
- * @whiteboard_new: Creates a new protocol-specific whiteboard object that
- * subclasses #PurpleWhiteboard.
- * The protocol factory interface.
- * This interface provides callbacks for construction of protocol-specific
- * subclasses of some purple objects.
-struct _PurpleProtocolFactoryInterface {
- GTypeInterface parent_iface;
- PurpleWhiteboard *(*whiteboard_new)(PurpleProtocolFactory *factory,
- PurpleAccount *account,
- * purple_protocol_factory_get_type:
- * The standard `_get_type` function for #PurpleProtocolFactory.
- * Returns: The #GType for the protocol factory interface.
- * purple_protocol_factory_whiteboard_new:
- * @factory: The #PurpleProtocolFactory instance.
- * @account: The #PurpleAccount instance to create a whiteboard for.
- * @who: The name of the contact to create a whiteboard with.
- * Creates a new protocol-specific #PurpleWhiteboard subclass.
- * Returns: (transfer full): The new #PurpleWhiteboard subclass for @account
-PurpleWhiteboard *purple_protocol_factory_whiteboard_new(PurpleProtocolFactory *factory,
- PurpleAccount *account, const gchar *who, gint state);
-#endif /* PURPLE_PROTOCOL_FACTORY_H */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/libpurple/purpleprotocolwhiteboard.c Tue Sep 20 02:43:20 2022 -0500
@@ -0,0 +1,54 @@
+ * Purple - Internet Messaging Library + * Copyright (C) Pidgin Developers <devel@pidgin.im> + * Purple is the legal property of its developers, whose names are too numerous + * to list here. Please refer to the COPYRIGHT file distributed with this + * 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 2 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 <https://www.gnu.org/licenses/>. +#include "purpleprotocolwhiteboard.h" +/****************************************************************************** + * GObject Implementation + *****************************************************************************/ +G_DEFINE_INTERFACE(PurpleProtocolWhiteboard, purple_protocol_whiteboard, +purple_protocol_whiteboard_default_init(PurpleProtocolWhiteboardInterface *iface) +/****************************************************************************** + *****************************************************************************/ +purple_protocol_whiteboard_create(PurpleProtocolWhiteboard *whiteboard, + PurpleAccount *account, const gchar *who, + PurpleProtocolWhiteboardInterface *iface = NULL; + g_return_val_if_fail(PURPLE_IS_PROTOCOL_WHITEBOARD(whiteboard), NULL); + iface = PURPLE_PROTOCOL_WHITEBOARD_GET_IFACE(whiteboard); + if(iface != NULL && iface->create != NULL) { + return iface->create(whiteboard, account, who, state); --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/libpurple/purpleprotocolwhiteboard.h Tue Sep 20 02:43:20 2022 -0500
@@ -0,0 +1,89 @@
+ * Purple - Internet Messaging Library + * Copyright (C) Pidgin Developers <devel@pidgin.im> + * Purple is the legal property of its developers, whose names are too numerous + * to list here. Please refer to the COPYRIGHT file distributed with this + * 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 2 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 <https://www.gnu.org/licenses/>. +#if !defined(PURPLE_GLOBAL_HEADER_INSIDE) && !defined(PURPLE_COMPILATION) +# error "only <purple.h> may be included directly" +#ifndef PURPLE_PROTOCOL_WHITEBOARD_H +#define PURPLE_PROTOCOL_WHITEBOARD_H +#include <glib-object.h> +#include <libpurple/account.h> +#include <libpurple/purplewhiteboard.h> +#define PURPLE_TYPE_PROTOCOL_WHITEBOARD (purple_protocol_whiteboard_get_type()) +G_DECLARE_INTERFACE(PurpleProtocolWhiteboard, purple_protocol_whiteboard, PURPLE, + PROTOCOL_WHITEBOARD, PurpleProtocol) + * PurpleProtocolWhiteboard: + * The #PurpleProtocolWhiteboard interface defines the behavior of a protocol's + * whiteboard interface. + * PurpleProtocolWhiteboardInterface: + * @create: Creates a new whiteboard. + * The protocol whiteboard interface. + * This interface provides a gateway between purple and the protocol. +struct _PurpleProtocolWhiteboardInterface { + PurpleWhiteboard *(*create)(PurpleProtocolWhiteboard *whiteboard, PurpleAccount *account, const gchar *who, gint state); + * purple_protocol_whiteboard_create: + * @whiteboard: The instance. + * @account: The [class@Purple.Account]. + * @who: The username of the contact who the whiteboard is being created for. + * @state: The initial state of the whiteboard. + * Creates a new [class@Purple.Whiteboard]. + * Returns: (transfer full): The new whiteboard instance. +PurpleWhiteboard *purple_protocol_whiteboard_create(PurpleProtocolWhiteboard *actions, PurpleAccount *account, const gchar *who, gint state); +#endif /* PURPLE_PROTOCOL_WHITEBOARD_H */ --- a/libpurple/purplewhiteboard.c Tue Sep 20 02:24:00 2022 -0500
+++ b/libpurple/purplewhiteboard.c Tue Sep 20 02:43:20 2022 -0500
@@ -24,7 +24,7 @@
#include "purplewhiteboard.h"
#include "purpleprotocol.h"
-#include "purpleprotocolfactory.h"
+#include "purpleprotocolwhiteboard.h" #include "purplewhiteboarduiops.h"
@@ -475,9 +475,9 @@
g_return_val_if_fail(PURPLE_IS_PROTOCOL(protocol), NULL);
- if(PURPLE_IS_PROTOCOL_FACTORY(protocol)) {
- whiteboard = purple_protocol_factory_whiteboard_new(
- PURPLE_PROTOCOL_FACTORY(protocol), account, id, state);
+ if(PURPLE_IS_PROTOCOL_WHITEBOARD(protocol)) { + whiteboard = purple_protocol_whiteboard_create( + PURPLE_PROTOCOL_WHITEBOARD(protocol), account, id, state); whiteboard = g_object_new(PURPLE_TYPE_WHITEBOARD,
--- a/libpurple/roomlist.c Tue Sep 20 02:24:00 2022 -0500
+++ b/libpurple/roomlist.c Tue Sep 20 02:43:20 2022 -0500
@@ -22,7 +22,6 @@
-#include "purpleprotocolfactory.h"
--- a/po/POTFILES.in Tue Sep 20 02:24:00 2022 -0500
+++ b/po/POTFILES.in Tue Sep 20 02:43:20 2022 -0500
@@ -265,13 +265,13 @@
libpurple/purpleprotocol.c
libpurple/purpleprotocolchat.c
libpurple/purpleprotocolclient.c
-libpurple/purpleprotocolfactory.c
libpurple/purpleprotocolim.c
libpurple/purpleprotocolmanager.c
libpurple/purpleprotocolmedia.c
libpurple/purpleprotocolprivacy.c
libpurple/purpleprotocolroomlist.c
libpurple/purpleprotocolserver.c
+libpurple/purpleprotocolwhiteboard.c libpurple/purplesqlitehistoryadapter.c
libpurple/purplewhiteboard.c