qulogic/pidgin

Stub out dnsapi implementation.
draft win-mdns
2021-01-01, Elliott Sales de Andrade
2b333e953bd1
Parents 320f1e6a616d
Children 69eee16785bf
Stub out dnsapi implementation.
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/libpurple/protocols/bonjour/mdns_dnsapi.c Fri Jan 01 02:53:52 2021 -0500
@@ -0,0 +1,139 @@
+/*
+ * 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
+ * source distribution.
+ *
+ * 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 <glib/gi18n-lib.h>
+
+#include <purple.h>
+
+#include "bonjour.h"
+#include "buddy.h"
+#include "dnsapi_proxy.h"
+#include "mdns_common.h"
+#include "mdns_dnsapi.h"
+
+/* data used by win32 bonjour implementation */
+typedef struct {
+ gpointer unused;
+} Win32SessionImplData;
+
+typedef struct {
+ gpointer unused;
+} Win32BuddyImplData;
+
+/****************************
+ * mdns_interface functions *
+ ****************************/
+
+static gboolean
+dnsapi_mdns_init_session(BonjourDnsSd *data)
+{
+ data->mdns_impl_data = g_new0(Win32SessionImplData, 1);
+
+ bonjour_dns_sd_set_jid(data->account, g_get_host_name());
+
+ return TRUE;
+}
+
+static gboolean
+dnsapi_mdns_publish(BonjourDnsSd *data, PublishType type, GSList *records)
+{
+ Win32SessionImplData *idata = data->mdns_impl_data;
+ gboolean ret = FALSE;
+
+ g_return_val_if_fail(idata != NULL, FALSE);
+
+ return ret;
+}
+
+static gboolean
+dnsapi_mdns_browse(BonjourDnsSd *data)
+{
+ Win32SessionImplData *idata = data->mdns_impl_data;
+
+ g_return_val_if_fail(idata != NULL, FALSE);
+
+ return FALSE;
+}
+
+static void
+dnsapi_mdns_stop(BonjourDnsSd *data)
+{
+ Win32SessionImplData *idata = data->mdns_impl_data;
+
+ g_return_if_fail(idata != NULL);
+
+ g_clear_pointer(&data->mdns_impl_data, g_free);
+}
+
+static gboolean
+dnsapi_mdns_set_buddy_icon_data(BonjourDnsSd *data, gconstpointer avatar_data,
+ gsize avatar_len)
+{
+ Win32SessionImplData *idata = data->mdns_impl_data;
+
+ g_return_val_if_fail(idata != NULL, FALSE);
+
+ return FALSE;
+}
+
+static void
+dnsapi_mdns_init_buddy(BonjourBuddy *buddy)
+{
+ buddy->mdns_impl_data = g_new0(Win32BuddyImplData, 1);
+}
+
+static void
+dnsapi_mdns_delete_buddy(BonjourBuddy *buddy)
+{
+ Win32BuddyImplData *idata = buddy->mdns_impl_data;
+
+ g_return_if_fail(idata != NULL);
+
+ g_clear_pointer(&buddy->mdns_impl_data, g_free);
+}
+
+static void
+dnsapi_mdns_retrieve_buddy_icon(BonjourBuddy *buddy)
+{
+ Win32BuddyImplData *idata = buddy->mdns_impl_data;
+
+ g_return_if_fail(idata != NULL);
+}
+
+gboolean
+dnsapi_mdns_available(void)
+{
+ if (!dnsapi_available()) {
+ return FALSE;
+ }
+
+ _mdns_init_session = dnsapi_mdns_init_session;
+ _mdns_publish = dnsapi_mdns_publish;
+ _mdns_browse = dnsapi_mdns_browse;
+ _mdns_stop = dnsapi_mdns_stop;
+ _mdns_set_buddy_icon_data = dnsapi_mdns_set_buddy_icon_data;
+ _mdns_init_buddy = dnsapi_mdns_init_buddy;
+ _mdns_delete_buddy = dnsapi_mdns_delete_buddy;
+ _mdns_retrieve_buddy_icon = dnsapi_mdns_retrieve_buddy_icon;
+
+ return TRUE;
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/libpurple/protocols/bonjour/mdns_dnsapi.h Fri Jan 01 02:53:52 2021 -0500
@@ -0,0 +1,25 @@
+/*
+ * 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
+ * source distribution.
+ *
+ * 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 <glib.h>
+
+gboolean dnsapi_mdns_available(void);
--- a/libpurple/protocols/bonjour/meson.build Wed Dec 30 03:37:58 2020 -0500
+++ b/libpurple/protocols/bonjour/meson.build Fri Jan 01 02:53:52 2021 -0500
@@ -16,7 +16,7 @@
if IS_WIN32
BONJOUR_SOURCES += [
- 'dnsapi_proxy.c',
+ 'dnsapi_proxy.c', 'dnsapi_proxy.h', 'mdns_dnsapi.c', 'mdns_dnsapi.h',
'dns_sd_proxy.c', 'dns_sd_proxy.h', 'mdns_dns_sd.c', 'mdns_dns_sd.h',
'mdns_win32.c'
]