1 --- gnomeShellPidgin.c.orig 2011-10-04 21:47:46.000000000 +0200
2 +++ gnomeShellPidgin.c 2011-10-09 13:31:07.000000000 +0200
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);
13 message(params->plugin,error->message);
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);
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)
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",
52 + PURPLE_CALLBACK(account_status_changed_cb),
64 static void init_plugin(PurplePlugin *plugin)
69 PURPLE_INIT_PLUGIN(dbus_example, init_plugin, info)