pidgin/pidgin

Parents 413ef6af21ab
Children cb26b9c6d4d0
fix some issues that were identified while working on a flatpak build

Fix some issues that were discovered while working on a flatpak

Testing Done:
built a flatpak (that'll be a separate review request) and ran into some issues..

First was bonjour_ft wouldn't build, not sure how/why that isn't happening elsewhere.. but whatever..

Next was the network monitor stuff I moved us to way back in december of 2015 works, but under flatpak the network is initially unavailable but then becomes available. A bunch of our code was __only__ checking network availability at startup and then not listening for changes later. This code is really gross right now, but a lot of it is going to need some major refactoring where as this effort was just to get this going right now.

Reviewed at https://reviews.imfreedom.org/r/66/
--- a/.hgignore Sat Aug 08 23:42:30 2020 -0500
+++ b/.hgignore Mon Aug 10 19:59:56 2020 -0500
@@ -1,6 +1,7 @@
syntax: glob
.*.swp
.DS_Store
+.flatpak-builder
*.pyc
*~
\#*\#
--- a/libpurple/accounts.c Sat Aug 08 23:42:30 2020 -0500
+++ b/libpurple/accounts.c Mon Aug 10 19:59:56 2020 -0500
@@ -36,6 +36,15 @@
static guint save_timer = 0;
static gboolean accounts_loaded = FALSE;
+static void
+purple_accounts_network_changed_cb(GNetworkMonitor *m, gboolean available,
+ gpointer data)
+{
+ if(available) {
+ purple_accounts_restore_current_statuses();
+ }
+}
+
/*********************************************************************
* Writing to disk *
*********************************************************************/
@@ -986,6 +995,9 @@
load_accounts();
+ g_signal_connect(G_OBJECT(g_network_monitor_get_default()),
+ "network-changed",
+ purple_accounts_network_changed_cb, NULL);
}
void
--- a/libpurple/protocols/bonjour/bonjour_ft.c Sat Aug 08 23:42:30 2020 -0500
+++ b/libpurple/protocols/bonjour/bonjour_ft.c Mon Aug 10 19:59:56 2020 -0500
@@ -28,6 +28,7 @@
# include <netdb.h>
# include <sys/socket.h>
#endif
+#include <errno.h>
#include <purple.h>
--- a/pidgin/gtkstatusbox.c Sat Aug 08 23:42:30 2020 -0500
+++ b/pidgin/gtkstatusbox.c Mon Aug 10 19:59:56 2020 -0500
@@ -177,6 +177,13 @@
static void pidgin_status_box_class_init (PidginStatusBoxClass *klass);
static void pidgin_status_box_init (PidginStatusBox *status_box);
+static void
+pidgin_status_box_network_changed_cb(GNetworkMonitor *m, gboolean available,
+ gpointer data)
+{
+ pidgin_status_box_set_network_available(PIDGIN_STATUS_BOX(data), available);
+}
+
GType
pidgin_status_box_get_type (void)
{
@@ -1769,6 +1776,10 @@
purple_prefs_connect_callback(status_box, PIDGIN_PREFS_ROOT "/accounts/buddyicon",
update_buddyicon_cb, status_box);
+ g_signal_connect(G_OBJECT(g_network_monitor_get_default()),
+ "network-changed",
+ G_CALLBACK(pidgin_status_box_network_changed_cb),
+ status_box);
}
static void