pep_geoloc.c
changeset 31 e404cd1c7077
parent 29 23fa36d480fb
child 35 a77a8e7ab8ae
equal deleted inserted replaced
30:a66ed0454ca8 31:e404cd1c7077
    32 #include <mcabber/hooks.h>
    32 #include <mcabber/hooks.h>
    33 #include <mcabber/settings.h>
    33 #include <mcabber/settings.h>
    34 #include <mcabber/modules.h>
    34 #include <mcabber/modules.h>
    35 
    35 
    36 #include "pep.h"
    36 #include "pep.h"
    37 #include "geoloc.h"
    37 #include "pep_geoloc.h"
    38 
    38 
    39 #include "config.h"
    39 #include "config.h"
    40 
    40 
    41 //
    41 //
    42 //  module description
    42 //  module description
    43 //
    43 //
    44 
    44 
    45 void pep_geoloc_init   (void);
    45 void pep_geoloc_init   (void);
    46 void pep_geoloc_uninit (void);
    46 void pep_geoloc_uninit (void);
    47 
    47 
    48 #define DESCRIPTION ( \
    48 #define DESCRIPTION ( PEP_GEOLOC_DESCRIPTION )
    49 	"PEP geoloc event handling\n" \
       
    50 	"Recognizes option geoloc_interval" )
       
    51 
    49 
    52 static const gchar *deps[] = { "pep", NULL };
    50 static const gchar *deps[] = { "pep", NULL };
    53 
    51 
    54 static module_info_t info_geoloc_dev = {
    52 static module_info_t info_geoloc_dev = {
    55 	.branch      = "dev",
    53 	.branch      = "dev",
   419 
   417 
   420 void pep_geoloc_init (void)
   418 void pep_geoloc_init (void)
   421 {
   419 {
   422 	geoloc_gerror_quark = g_quark_from_string ( "pep-geoloc-gerror-quark" );
   420 	geoloc_gerror_quark = g_quark_from_string ( "pep-geoloc-gerror-quark" );
   423 
   421 
   424 	geoloc_interval = settings_opt_get_int ("geoloc_interval");
   422 	geoloc_interval = settings_opt_get_int ( OPT_GEOLOC_INTERVAL );
   425 
   423 
   426 	geoloc_guard_installed = settings_set_guard ("geoloc_interval", geoloc_guard);
   424 	geoloc_guard_installed = settings_set_guard (OPT_GEOLOC_INTERVAL, geoloc_guard);
   427 	if (!geoloc_guard_installed)
   425 	if (!geoloc_guard_installed)
   428 		scr_log_print (LPRINT_LOGNORM, "geoloc: Warning: cannot install option guard for 'geoloc_interval'.");
   426 		scr_log_print (LPRINT_LOGNORM, "geoloc: Warning: cannot install option guard for '" OPT_GEOLOC_INTERVAL "'.");
   429 
   427 
   430 	pep_register_xmlns_handler (NS_GEOLOC, geoloc_handler, NULL, NULL);
   428 	pep_register_xmlns_handler (NS_GEOLOC, geoloc_handler, NULL, NULL);
   431 
   429 
   432 	geoloc_reply_handler = lm_message_handler_new (geoloc_publish_reply_handler, NULL, NULL);
   430 	geoloc_reply_handler = lm_message_handler_new (geoloc_publish_reply_handler, NULL, NULL);
   433 
   431 
   466 			if (info[i].value)
   464 			if (info[i].value)
   467 				g_free (info[i].value);
   465 				g_free (info[i].value);
   468 	}
   466 	}
   469 
   467 
   470 	if (geoloc_guard_installed)
   468 	if (geoloc_guard_installed)
   471 		settings_del_guard ("geoloc_interval");
   469 		settings_del_guard ( OPT_GEOLOC_INTERVAL );
   472 }
   470 }
   473 
   471 
   474 /* vim: se ts=4 sw=4: */
   472 /* vim: se ts=4 sw=4: */