# HG changeset patch
# Node ID 1d415372c2a6
# Parent  08b6b45431c9
diff --git a/ChangeLog.API b/ChangeLog.API
--- a/ChangeLog.API
+++ b/ChangeLog.API
@@ -572,6 +572,7 @@
 		* purple_network_get_my_ip
 		* purple_network_get_local_system_ip.  Use libnice instead.
 		* purple_network_get_port_from_fd
+		* purple_network_get_turn_ip
 		* purple_network_ip_atoi
 		* PurpleNetworkListenData
 		* PurpleNetworkListenCallback
@@ -582,6 +583,7 @@
 		* purple_network_listen_range
 		* purple_network_listen_range_family
 		* purple_network_remove_port_mapping
+		* purple_network_set_turn_server
 		* PurpleNotifyUiOps.notify_email
 		* PurpleNotifyUiOps.notify_emails
 		* purple_notify_email
diff --git a/libpurple/network.h b/libpurple/network.h
--- a/libpurple/network.h
+++ b/libpurple/network.h
@@ -130,24 +130,6 @@
 const gchar *purple_network_get_stun_ip(void);
 
 /**
- * purple_network_set_turn_server:
- * @turn_server: The host name of the TURN server to set
- *
- * Update the TURN server IP given the host name
- * Will result in a DNS query being executed asynchronous
- */
-void purple_network_set_turn_server(const gchar *turn_server);
-
-/**
- * purple_network_get_turn_ip:
- *
- * Get the IP address of the TURN server as a string representation
- *
- * Returns: the IP address
- */
-const gchar *purple_network_get_turn_ip(void);
-
-/**
  * _purple_network_set_common_socket_flags:
  * @fd: The file descriptor for the socket.
  *
diff --git a/libpurple/network.c b/libpurple/network.c
--- a/libpurple/network.c
+++ b/libpurple/network.c
@@ -51,7 +51,6 @@
 
 /* Cached IP addresses for STUN and TURN servers (set globally in prefs) */
 static gchar *stun_ip = NULL;
-static gchar *turn_ip = NULL;
 
 void
 purple_network_set_public_ip(const char *ip)
@@ -233,41 +232,12 @@
 	}
 }
 
-void
-purple_network_set_turn_server(const gchar *turn_server)
-{
-	if (turn_server && turn_server[0] != '\0') {
-		if (purple_network_is_available()) {
-			GResolver *resolver = g_resolver_get_default();
-			g_resolver_lookup_by_name_async(resolver,
-			                                turn_server,
-			                                NULL,
-			                                purple_network_ip_lookup_cb,
-			                                &turn_ip);
-			g_object_unref(resolver);
-		} else {
-			purple_debug_info("network",
-				"network is unavailable, don't try to update TURN IP");
-		}
-	} else {
-		g_free(turn_ip);
-		turn_ip = NULL;
-	}
-}
-
-
 const gchar *
 purple_network_get_stun_ip(void)
 {
 	return stun_ip;
 }
 
-const gchar *
-purple_network_get_turn_ip(void)
-{
-	return turn_ip;
-}
-
 gboolean
 _purple_network_set_common_socket_flags(int fd)
 {
@@ -316,13 +286,10 @@
 
 	purple_network_set_stun_server(
 		purple_prefs_get_string("/purple/network/stun_server"));
-	purple_network_set_turn_server(
-		purple_prefs_get_string("/purple/network/turn_server"));
 }
 
 void
 purple_network_uninit(void)
 {
 	g_free(stun_ip);
-	g_free(turn_ip);
 }
diff --git a/pidgin/prefs/pidginnetworkprefs.c b/pidgin/prefs/pidginnetworkprefs.c
--- a/pidgin/prefs/pidginnetworkprefs.c
+++ b/pidgin/prefs/pidginnetworkprefs.c
@@ -40,11 +40,6 @@
 	GtkWidget *ports_range_use;
 	GtkWidget *ports_range_start;
 	GtkWidget *ports_range_end;
-	GtkWidget *turn_server;
-	GtkWidget *turn_port_udp;
-	GtkWidget *turn_port_tcp;
-	GtkWidget *turn_username;
-	GtkWidget *turn_password;
 };
 
 G_DEFINE_TYPE(PidginNetworkPrefs, pidgin_network_prefs,
@@ -88,17 +83,6 @@
 }
 
 static void
-network_turn_server_changed_cb(G_GNUC_UNUSED GtkEventControllerFocus *focus,
-                               gpointer data)
-{
-	GtkEditable *editable = data;
-
-	purple_prefs_set_string("/purple/network/turn_server",
-	                        gtk_editable_get_text(editable));
-	purple_network_set_turn_server(gtk_editable_get_text(editable));
-}
-
-static void
 auto_ip_button_clicked_cb(G_GNUC_UNUSED GObject *obj,
                           G_GNUC_UNUSED GParamSpec *pspec, gpointer data)
 {
@@ -161,23 +145,11 @@
 	                                     ports_range_start);
 	gtk_widget_class_bind_template_child(widget_class, PidginNetworkPrefs,
 	                                     ports_range_end);
-	gtk_widget_class_bind_template_child(widget_class, PidginNetworkPrefs,
-	                                     turn_server);
-	gtk_widget_class_bind_template_child(widget_class, PidginNetworkPrefs,
-	                                     turn_port_udp);
-	gtk_widget_class_bind_template_child(widget_class, PidginNetworkPrefs,
-	                                     turn_port_tcp);
-	gtk_widget_class_bind_template_child(widget_class, PidginNetworkPrefs,
-	                                     turn_username);
-	gtk_widget_class_bind_template_child(widget_class, PidginNetworkPrefs,
-	                                     turn_password);
 	gtk_widget_class_bind_template_callback(widget_class,
 	                                        network_stun_server_changed_cb);
 	gtk_widget_class_bind_template_callback(widget_class,
 	                                        auto_ip_button_clicked_cb);
 	gtk_widget_class_bind_template_callback(widget_class, network_ip_changed);
-	gtk_widget_class_bind_template_callback(widget_class,
-	                                        network_turn_server_changed_cb);
 }
 
 static void
@@ -203,21 +175,6 @@
 			prefs->ports_range_start);
 	pidgin_prefs_bind_spin_button("/purple/network/ports_range_end",
 			prefs->ports_range_end);
-
-	/* TURN server */
-	gtk_editable_set_text(GTK_EDITABLE(prefs->turn_server),
-	                      purple_prefs_get_string("/purple/network/turn_server"));
-
-	pidgin_prefs_bind_spin_button("/purple/network/turn_port",
-			prefs->turn_port_udp);
-
-	pidgin_prefs_bind_spin_button("/purple/network/turn_port_tcp",
-			prefs->turn_port_tcp);
-
-	pidgin_prefs_bind_entry("/purple/network/turn_username",
-			prefs->turn_username);
-	pidgin_prefs_bind_entry("/purple/network/turn_password",
-			prefs->turn_password);
 }
 
 /******************************************************************************
diff --git a/pidgin/resources/Prefs/network.ui b/pidgin/resources/Prefs/network.ui
--- a/pidgin/resources/Prefs/network.ui
+++ b/pidgin/resources/Prefs/network.ui
@@ -33,16 +33,6 @@
     <property name="step-increment">1</property>
     <property name="page-increment">10</property>
   </object>
-  <object class="GtkAdjustment" id="turn_port_tcp.adjustment">
-    <property name="upper">65535</property>
-    <property name="step-increment">1</property>
-    <property name="page-increment">10</property>
-  </object>
-  <object class="GtkAdjustment" id="turn_port_udp.adjustment">
-    <property name="upper">65535</property>
-    <property name="step-increment">1</property>
-    <property name="page-increment">10</property>
-  </object>
   <template class="PidginNetworkPrefs" parent="AdwPreferencesPage">
     <child>
       <object class="AdwPreferencesGroup">
@@ -145,67 +135,5 @@
         </child>
       </object>
     </child>
-    <child>
-      <object class="AdwPreferencesGroup">
-        <property name="title" translatable="1">Relay Server (TURN)</property>
-        <child>
-          <object class="AdwEntryRow" id="turn_server">
-            <property name="title" translatable="1">_TURN server</property>
-            <property name="use-underline">1</property>
-            <child>
-              <object class="GtkEventControllerFocus">
-                <signal name="leave" handler="network_turn_server_changed_cb" object="turn_server" swapped="no"/>
-              </object>
-            </child>
-          </object>
-        </child>
-        <child>
-          <object class="AdwActionRow">
-            <property name="activatable-widget">turn_port_udp</property>
-            <property name="title" translatable="1">_UDP Port</property>
-            <property name="use-underline">1</property>
-            <property name="focusable">0</property>
-            <child>
-              <object class="GtkSpinButton" id="turn_port_udp">
-                <property name="focusable">1</property>
-                <property name="hexpand">1</property>
-                <property name="valign">center</property>
-                <property name="adjustment">turn_port_udp.adjustment</property>
-                <property name="numeric">1</property>
-              </object>
-            </child>
-          </object>
-        </child>
-        <child>
-          <object class="AdwActionRow">
-            <property name="activatable-widget">turn_port_tcp</property>
-            <property name="title" translatable="1">T_CP Port</property>
-            <property name="use-underline">1</property>
-            <property name="focusable">0</property>
-            <child>
-              <object class="GtkSpinButton" id="turn_port_tcp">
-                <property name="focusable">1</property>
-                <property name="hexpand">1</property>
-                <property name="valign">center</property>
-                <property name="adjustment">turn_port_tcp.adjustment</property>
-                <property name="numeric">1</property>
-              </object>
-            </child>
-          </object>
-        </child>
-        <child>
-          <object class="AdwEntryRow" id="turn_username">
-            <property name="title" translatable="1">Use_rname</property>
-            <property name="use-underline">1</property>
-          </object>
-        </child>
-        <child>
-          <object class="AdwPasswordEntryRow" id="turn_password">
-            <property name="title" translatable="1">Pass_word</property>
-            <property name="use-underline">1</property>
-          </object>
-        </child>
-      </object>
-    </child>
   </template>
 </interface>
