disco.c
changeset 27 0539bca09f11
parent 26 91987ea19f24
child 28 ff36ae7e2b1e
equal deleted inserted replaced
26:91987ea19f24 27:0539bca09f11
    17  *
    17  *
    18  * You should have received a copy of the GNU General Public License
    18  * You should have received a copy of the GNU General Public License
    19  * along with this program.  If not, see <http://www.gnu.org/licenses/>. */
    19  * along with this program.  If not, see <http://www.gnu.org/licenses/>. */
    20 
    20 
    21 #include <glib.h>
    21 #include <glib.h>
    22 #include <gmodule.h>
       
    23 #include <loudmouth/loudmouth.h>
    22 #include <loudmouth/loudmouth.h>
    24 #include <string.h>
    23 #include <string.h>
    25 
    24 
    26 #include <mcabber/commands.h>
    25 #include <mcabber/commands.h>
    27 #include <mcabber/logprint.h>
    26 #include <mcabber/logprint.h>
    30 #include <mcabber/xmpp.h>
    29 #include <mcabber/xmpp.h>
    31 #include <mcabber/compl.h>
    30 #include <mcabber/compl.h>
    32 #include <mcabber/xmpp_defines.h>
    31 #include <mcabber/xmpp_defines.h>
    33 #include <mcabber/screen.h>
    32 #include <mcabber/screen.h>
    34 #include <mcabber/hbuf.h>
    33 #include <mcabber/hbuf.h>
       
    34 #include <mcabber/modules.h>
    35 
    35 
    36 #include "disco.h"
    36 #include "disco.h"
    37 
    37 
    38 #include "config.h"
    38 #include "config.h"
       
    39 
       
    40 //
       
    41 // module description
       
    42 //
       
    43 
       
    44 static void disco_init   (void);
       
    45 static void disco_uninit (void);
       
    46 
       
    47 module_info_t info_disco = {
       
    48 	.mcabber_version = "0.10.0",
       
    49 	.requires        = NULL,
       
    50 	.init            = disco_init,
       
    51 	.uninit          = disco_uninit,
       
    52 };
    39 
    53 
    40 //
    54 //
    41 // private types
    55 // private types
    42 //
    56 //
    43 
    57 
   596 {
   610 {
   597 	disco_unregister_handlers ();
   611 	disco_unregister_handlers ();
   598 	return;
   612 	return;
   599 }
   613 }
   600 
   614 
   601 const gchar *g_module_check_init(GModule *module)
   615 static void disco_init (void)
   602 {
   616 {
   603 	// completion
   617 	// completion
   604 	disco_cid = compl_new_category ();
   618 	disco_cid = compl_new_category ();
   605 	if (disco_cid) {
   619 	if (disco_cid) {
   606 		compl_add_category_word (disco_cid, "info");
   620 		compl_add_category_word (disco_cid, "info");
   611 	hk_add_handler (disco_hh, HOOK_PRE_DISCONNECT, NULL);
   625 	hk_add_handler (disco_hh, HOOK_PRE_DISCONNECT, NULL);
   612 
   626 
   613 	// command
   627 	// command
   614 	cmd_add ("disco", "", disco_cid, COMPL_JID, do_disco, NULL);
   628 	cmd_add ("disco", "", disco_cid, COMPL_JID, do_disco, NULL);
   615 
   629 
   616 	return NULL;
   630 	return;
   617 }
   631 }
   618 
   632 
   619 void g_module_unload(GModule *module)
   633 static void disco_uninit (void)
   620 {
   634 {
   621 	// command
   635 	// command
   622 	cmd_del ("disco");
   636 	cmd_del ("disco");
   623 
   637 
   624 	// completion
   638 	// completion