pidgin/pidgin

Parents 17f602456139
Children effcb245f840
Remove the media implementation from the Demo protocol plugin

This API will be rewritten in the future, but keeping the old version around
isn't helping anything.

Testing Done:
Dialed TMNT

Reviewed at https://reviews.imfreedom.org/r/3174/
--- a/protocols/demo/meson.build Thu May 09 20:43:55 2024 -0500
+++ b/protocols/demo/meson.build Thu May 09 20:50:45 2024 -0500
@@ -15,8 +15,6 @@
'purpledemoprotocolcontacts.h',
'purpledemoprotocolconversation.c',
'purpledemoprotocolconversation.h',
- 'purpledemoprotocolmedia.c',
- 'purpledemoprotocolmedia.h',
]
if DYNAMIC_DEMO
--- a/protocols/demo/purpledemoprotocol.c Thu May 09 20:43:55 2024 -0500
+++ b/protocols/demo/purpledemoprotocol.c Thu May 09 20:50:45 2024 -0500
@@ -25,7 +25,6 @@
#include "purpledemoprotocolclient.h"
#include "purpledemoprotocolcontacts.h"
#include "purpledemoprotocolconversation.h"
-#include "purpledemoprotocolmedia.h"
struct _PurpleDemoProtocol {
PurpleProtocol parent;
@@ -67,9 +66,7 @@
G_IMPLEMENT_INTERFACE_DYNAMIC(PURPLE_TYPE_PROTOCOL_CONTACTS,
purple_demo_protocol_contacts_init)
G_IMPLEMENT_INTERFACE_DYNAMIC(PURPLE_TYPE_PROTOCOL_CONVERSATION,
- purple_demo_protocol_conversation_init)
- G_IMPLEMENT_INTERFACE_DYNAMIC(PURPLE_TYPE_PROTOCOL_MEDIA,
- purple_demo_protocol_media_init))
+ purple_demo_protocol_conversation_init))
static void
purple_demo_protocol_init(G_GNUC_UNUSED PurpleDemoProtocol *protocol) {
--- a/protocols/demo/purpledemoprotocolmedia.c Thu May 09 20:43:55 2024 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,73 +0,0 @@
-/*
- * 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 "purpledemoprotocol.h"
-#include "purpledemoprotocolmedia.h"
-
-/******************************************************************************
- * PurpleProtocolMedia Implementation
- *****************************************************************************/
-static PurpleMediaCaps
-purple_demo_protocol_media_get_caps(G_GNUC_UNUSED PurpleProtocolMedia *media,
- G_GNUC_UNUSED PurpleAccount *account,
- const gchar *who)
-{
- if(purple_strequal(who, "Echo")) {
- return PURPLE_MEDIA_CAPS_AUDIO | PURPLE_MEDIA_CAPS_VIDEO |
- PURPLE_MEDIA_CAPS_AUDIO_VIDEO;
- }
-
- return PURPLE_MEDIA_CAPS_NONE;
-}
-
-static gboolean
-purple_demo_protocol_media_initiate_session(G_GNUC_UNUSED PurpleProtocolMedia *media,
- G_GNUC_UNUSED PurpleAccount *account,
- const char *who,
- PurpleMediaSessionType type)
-{
- gchar *session_name = NULL;
-
- session_name = g_flags_to_string(PURPLE_MEDIA_TYPE_SESSION_TYPE, type);
- g_warning(_("Initiated demo %s session with %s"), session_name, who);
- g_free(session_name);
-
- /* TODO: When libpurple gets a backend, we can implement more of this. */
- return FALSE;
-}
-
-static gboolean
-purple_demo_protocol_media_send_dtmf(G_GNUC_UNUSED PurpleProtocolMedia *protocol_media,
- G_GNUC_UNUSED PurpleMedia *media,
- char dtmf,
- guint8 volume, guint8 duration)
-{
- g_warning(_("Received DTMF %c at volume %d for %d seconds"),
- dtmf, volume, duration);
-
- return TRUE;
-}
-
-void
-purple_demo_protocol_media_init(PurpleProtocolMediaInterface *iface) {
- iface->get_caps = purple_demo_protocol_media_get_caps;
- iface->initiate_session = purple_demo_protocol_media_initiate_session;
- iface->send_dtmf = purple_demo_protocol_media_send_dtmf;
-}
--- a/protocols/demo/purpledemoprotocolmedia.h Thu May 09 20:43:55 2024 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,28 +0,0 @@
-/*
- * 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_DEMO_PROTOCOL_MEDIA_H
-#define PURPLE_DEMO_PROTOCOL_MEDIA_H
-
-#include <glib.h>
-
-#include <purple.h>
-
-G_GNUC_INTERNAL void purple_demo_protocol_media_init(PurpleProtocolMediaInterface *iface);
-
-#endif /* PURPLE_DEMO_PROTOCOL_MEDIA_H */