--- a/disco.c Sun Feb 17 06:58:49 2013 +0200
+++ b/disco.c Thu Nov 13 18:50:18 2014 +0200
@@ -22,17 +22,18 @@
#include <loudmouth/loudmouth.h>
#include <string.h>
-#include <mcabber/commands.h>
-#include <mcabber/logprint.h>
-#include <mcabber/utils.h>
-#include <mcabber/hooks.h>
-#include <mcabber/xmpp.h>
-#include <mcabber/compl.h>
-#include <mcabber/xmpp_defines.h>
-#include <mcabber/screen.h>
-#include <mcabber/hbuf.h>
-#include <mcabber/modules.h>
-#include <mcabber/caps.h>
+//#include <mcabber/caps.h>
+#include <mcabber/commands.h> // cmd_add (), cmd_del ()
+#include <mcabber/compl.h> // compl_new_category (), compl_del_category (), compl_add_category_word ()
+#include <mcabber/hbuf.h> // HBB_PREFIX_INFO
+#include <mcabber/hooks.h> // hk_add_handler (), hk_del_handler (), HOOK_PRE_DISCONNECT, HOOK_HANDLER_RESULT_*
+#include <mcabber/logprint.h> // scr_log_print ()
+#include <mcabber/modules.h> // module_info_t
+#include <mcabber/roster.h> // buddy_getjid (), buddy_gettype (), current_buddy, BUDDATA ()
+#include <mcabber/screen.h> // scr_write_incoming_message ()
+#include <mcabber/utils.h> // to_utf8 (), free_arg_lst (), jidtodisp ()
+#include <mcabber/xmpp.h> // xmpp_is_online (), lconnection
+#include <mcabber/xmpp_defines.h> // NS_DISCO_INFO, NS_DISCO_ITEMS
#include "disco.h"
@@ -87,7 +88,7 @@
// globals
//
-#ifdef MCABBER_API_HAVE_CMD_ID
+#ifdef HAVE_MCABBER_CMD_ID
static gpointer disco_cmid = NULL;
#endif
static guint disco_cid = 0;
@@ -550,7 +551,7 @@
if (bud) {
guint type = buddy_gettype (bud);
if (type != ROSTER_TYPE_GROUP && type != ROSTER_TYPE_SPECIAL)
- to = g_strdup (buddy_getjid (bud)); // XXX memleak!
+ to = g_strdup (buddy_getjid (bud));
}
}
}
@@ -611,7 +612,7 @@
void disco_init (void)
{
// completion
-#ifdef MCABBER_API_HAVE_COMPL_FLAGS
+#ifdef HAVE_MCABBER_COMPLETION_FLAGS
disco_cid = compl_new_category (COMPL_FLAGS_SORT);
#else
disco_cid = compl_new_category ();
@@ -625,7 +626,7 @@
disco_hid = hk_add_handler (disco_hh, HOOK_PRE_DISCONNECT, G_PRIORITY_DEFAULT, NULL);
// command
-#ifndef MCABBER_API_HAVE_CMD_ID
+#ifndef HAVE_MCABBER_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);
@@ -637,7 +638,7 @@
void disco_uninit (void)
{
// command
-#ifndef MCABBER_API_HAVE_CMD_ID
+#ifndef HAVE_MCABBER_CMD_ID
cmd_del ("disco");
#else
if (disco_cmid)