--- a/disco.c Wed Nov 10 11:47:31 2010 +0100
+++ b/disco.c Mon Mar 07 19:41:44 2011 +0100
@@ -49,7 +49,7 @@
static module_info_t info_disco_experimental = {
.branch = "experimental",
- .api = 10,
+ .api = 32,
.version = PROJECT_VERSION,
.description = DESCRIPTION,
.requires = NULL,
@@ -58,9 +58,9 @@
.next = NULL,
};
-module_info_t info_disco = {
+static module_info_t info_disco_dev = {
.branch = "dev",
- .api = 16,
+ .api = 13,
.version = PROJECT_VERSION,
.description = DESCRIPTION,
.requires = NULL,
@@ -69,6 +69,17 @@
.next = &info_disco_experimental,
};
+module_info_t info_disco = {
+ .branch = "0.10.1",
+ .api = 1,
+ .version = PROJECT_VERSION,
+ .description = DESCRIPTION,
+ .requires = NULL,
+ .init = disco_init,
+ .uninit = disco_uninit,
+ .next = &info_disco_dev,
+};
+
//
// private types
//
@@ -97,6 +108,10 @@
// globals
//
+#ifdef HAVE_CMD_ID
+static gpointer disco_cmid = NULL;
+#endif
+
static guint disco_cid = 0;
static guint disco_hid = 0;
static GSList *reply_handlers = NULL;
@@ -586,22 +601,22 @@
dnode = to_utf8 (args[2]);
}
- if (!to) {
- // Use currently selected item, if possible
+ if (!to) {
+ // Use currently selected item, if possible
if (current_buddy) {
- gpointer bud = BUDDATA(current_buddy);
+ gpointer bud = BUDDATA(current_buddy);
if (bud) {
guint type = buddy_gettype (bud);
if (type != ROSTER_TYPE_GROUP && type != ROSTER_TYPE_SPECIAL)
to = g_strdup (buddy_getjid (bud)); // XXX memleak!
- }
+ }
}
- }
+ }
if (!to) {
- scr_log_print (LPRINT_NORMAL, "Invalid disco target.");
- free_arg_lst (args);
- return;
+ scr_log_print (LPRINT_NORMAL, "Invalid disco target.");
+ free_arg_lst (args);
+ return;
}
// XXX send to all resources/current resource?
@@ -665,7 +680,11 @@
disco_hid = hk_add_handler (disco_hh, HOOK_PRE_DISCONNECT, G_PRIORITY_DEFAULT, NULL);
// command
+#ifndef HAVE_CMD_ID
cmd_add ("disco", "", disco_cid, COMPL_JID, do_disco, NULL);
+#else
+ disco_cmid = cmd_add ("disco", "", disco_cid, COMPL_JID, do_disco, NULL);
+#endif
return;
}
@@ -673,7 +692,12 @@
static void disco_uninit (void)
{
// command
+#ifndef HAVE_CMD_ID
cmd_del ("disco");
+#else
+ if (disco_cmid)
+ cmd_del (disco_cmid);
+#endif
// completion
if (disco_cid)