]> www.infradead.org Git - pidgin-chime.git/commitdiff
Autoload seen plugin
authorDavid Woodhouse <dwmw@amazon.co.uk>
Fri, 27 Apr 2018 14:34:24 +0000 (15:34 +0100)
committerDavid Woodhouse <dwmw@amazon.co.uk>
Fri, 27 Apr 2018 14:34:24 +0000 (15:34 +0100)
chimeseen/chimeseen.c
prpl/chime.c

index 1c5df5033c8e99d08f0fb679f490dacc7c08cea3..7bc3f2f28748df75c82cf2b346aeeee62e56b6ac 100644 (file)
@@ -26,6 +26,7 @@
 #include <stdlib.h>
 #include <errno.h>
 
+#include "gtkplugin.h"
 #include "gtkutils.h"
 #include "gtkimhtml.h"
 
@@ -189,6 +190,7 @@ static PurplePluginInfo info =
        .major_version = PURPLE_MAJOR_VERSION,
        .minor_version = PURPLE_MINOR_VERSION,
        .type = PURPLE_PLUGIN_STANDARD,
+       .ui_requirement = PIDGIN_PLUGIN_TYPE,
        .priority = PURPLE_PRIORITY_DEFAULT,
        .id = (char *)"chimeseen",
        .name = (char *)"Chime Seen",
index a790cede13e5da4bda260ca79853592731e32461..e9f0b2315305caf23e3c559e5f150892f7791076 100644 (file)
@@ -182,10 +182,19 @@ static void get_machine_id(unsigned char *id, int len)
                id[i] = g_random_int_range(0, 256);
 }
 
+static void load_seen_plugin(void)
+{
+       PurplePlugin *seenplug = purple_plugins_find_with_basename("chimeseen");
+       if (seenplug)
+               purple_plugin_load(seenplug);
+}
+
 static void chime_purple_login(PurpleAccount *account)
 {
        PurpleConnection *conn = purple_account_get_connection(account);
 
+       load_seen_plugin();
+
        const gchar *devtoken = purple_account_get_string(account, "devtoken", NULL);
        /* Generate a stable device-id based on on the host identity and account name.
         * This helps prevent an explosion of separate "devices" being tracked on