20 |
20 |
21 #include <glib.h> |
21 #include <glib.h> |
22 #include <loudmouth/loudmouth.h> |
22 #include <loudmouth/loudmouth.h> |
23 #include <string.h> |
23 #include <string.h> |
24 |
24 |
25 #include <mcabber/commands.h> |
25 //#include <mcabber/caps.h> |
26 #include <mcabber/logprint.h> |
26 #include <mcabber/commands.h> // cmd_add (), cmd_del () |
27 #include <mcabber/utils.h> |
27 #include <mcabber/compl.h> // compl_new_category (), compl_del_category (), compl_add_category_word () |
28 #include <mcabber/hooks.h> |
28 #include <mcabber/hbuf.h> // HBB_PREFIX_INFO |
29 #include <mcabber/xmpp.h> |
29 #include <mcabber/hooks.h> // hk_add_handler (), hk_del_handler (), HOOK_PRE_DISCONNECT, HOOK_HANDLER_RESULT_* |
30 #include <mcabber/compl.h> |
30 #include <mcabber/logprint.h> // scr_log_print () |
31 #include <mcabber/xmpp_defines.h> |
31 #include <mcabber/modules.h> // module_info_t |
32 #include <mcabber/screen.h> |
32 #include <mcabber/roster.h> // buddy_getjid (), buddy_gettype (), current_buddy, BUDDATA () |
33 #include <mcabber/hbuf.h> |
33 #include <mcabber/screen.h> // scr_write_incoming_message () |
34 #include <mcabber/modules.h> |
34 #include <mcabber/utils.h> // to_utf8 (), free_arg_lst (), jidtodisp () |
35 #include <mcabber/caps.h> |
35 #include <mcabber/xmpp.h> // xmpp_is_online (), lconnection |
|
36 #include <mcabber/xmpp_defines.h> // NS_DISCO_INFO, NS_DISCO_ITEMS |
36 |
37 |
37 #include "disco.h" |
38 #include "disco.h" |
38 |
39 |
39 #include "config.h" |
40 #include "config.h" |
40 |
41 |
85 |
86 |
86 // |
87 // |
87 // globals |
88 // globals |
88 // |
89 // |
89 |
90 |
90 #ifdef MCABBER_API_HAVE_CMD_ID |
91 #ifdef HAVE_MCABBER_CMD_ID |
91 static gpointer disco_cmid = NULL; |
92 static gpointer disco_cmid = NULL; |
92 #endif |
93 #endif |
93 static guint disco_cid = 0; |
94 static guint disco_cid = 0; |
94 static guint disco_hid = 0; |
95 static guint disco_hid = 0; |
95 static GSList * disco_requests = NULL; |
96 static GSList * disco_requests = NULL; |
623 |
624 |
624 // hook handler |
625 // hook handler |
625 disco_hid = hk_add_handler (disco_hh, HOOK_PRE_DISCONNECT, G_PRIORITY_DEFAULT, NULL); |
626 disco_hid = hk_add_handler (disco_hh, HOOK_PRE_DISCONNECT, G_PRIORITY_DEFAULT, NULL); |
626 |
627 |
627 // command |
628 // command |
628 #ifndef MCABBER_API_HAVE_CMD_ID |
629 #ifndef HAVE_MCABBER_CMD_ID |
629 cmd_add ("disco", "", disco_cid, COMPL_JID, do_disco, NULL); |
630 cmd_add ("disco", "", disco_cid, COMPL_JID, do_disco, NULL); |
630 #else |
631 #else |
631 disco_cmid = cmd_add ("disco", "", disco_cid, COMPL_JID, do_disco, NULL); |
632 disco_cmid = cmd_add ("disco", "", disco_cid, COMPL_JID, do_disco, NULL); |
632 #endif |
633 #endif |
633 |
634 |