updated on Tue Jan 10 04:01:21 UTC 2012
[aur-mirror.git] / gnome-shell-pidgin / pidgin-status-to-shell.patch
blob88defdce21586a5b0394dd7167d2d49e37a65724
1 --- gnomeShellPidgin.c.orig 2011-10-04 21:47:46.000000000 +0200
2 +++ gnomeShellPidgin.c 2011-10-09 13:31:07.000000000 +0200
3 @@ -22,6 +22,8 @@
4 #include <dbus-maybe.h>
5 #include <dbus-bindings.h>
7 +PurplePlugin * g_plugin = NULL;
9 static void message(PurplePlugin* plugin,const char* msg)
11 purple_notify_message(plugin,PURPLE_NOTIFY_MSG_INFO,"Gnome-Shell Connector",msg,NULL,NULL,NULL);
12 @@ -107,12 +109,14 @@
13 message(params->plugin,error->message);
14 g_error_free(error);
16 + // printf("SET STATUS %i\n", status);
19 static void status_signal_handler(DBusGProxy* presence,guint gnome_status,PluginParams* params)
21 PurpleSavedStatus* current_status = purple_savedstatus_get_current();
22 guint current_pidgin_status = Purple2Gnome(purple_savedstatus_get_type(current_status));
23 + // printf("NEW STATUS %i\n", gnome_status);
24 if (current_pidgin_status < GNOME_NSTATUS && !purple_savedstatus_is_transient(current_status))
26 const char* title = purple_savedstatus_get_title(current_status);
27 @@ -136,6 +140,15 @@
31 +static void
32 +account_status_changed_cb(PurpleAccount *account, PurpleStatus *old, PurpleStatus *new, gpointer data)
34 + PurpleSavedStatus* currentStatus = purple_savedstatus_get_current();
35 + guint current_pidgin_status = Purple2Gnome(purple_savedstatus_get_type(currentStatus));
36 + SetInGnome(g_plugin->extra,Purple2Gnome(purple_savedstatus_get_type(currentStatus)));
37 + // printf(">> account_status_changed %i\n", current_pidgin_status);
40 static gboolean plugin_load(PurplePlugin *plugin)
42 DBusGProxy* presence;
43 @@ -160,6 +173,15 @@
44 SetInGnome(params,Purple2Gnome(purple_savedstatus_get_type(currentStatus)));
45 dbus_g_proxy_add_signal(presence,"StatusChanged",G_TYPE_UINT,G_TYPE_INVALID);
46 dbus_g_proxy_connect_signal(presence,"StatusChanged",G_CALLBACK(status_signal_handler),params,NULL);
48 + purple_signal_connect(
49 + purple_accounts_get_handle(),
50 + "account-status-changed",
51 + plugin,
52 + PURPLE_CALLBACK(account_status_changed_cb),
53 + NULL
54 + );
56 return TRUE;
59 @@ -200,9 +222,10 @@
60 NULL
64 static void init_plugin(PurplePlugin *plugin)
66 + g_plugin = plugin;
69 PURPLE_INIT_PLUGIN(dbus_example, init_plugin, info)