pep_mood.c
changeset 31 e404cd1c7077
parent 29 23fa36d480fb
child 35 a77a8e7ab8ae
equal deleted inserted replaced
30:a66ed0454ca8 31:e404cd1c7077
    29 #include <mcabber/logprint.h>
    29 #include <mcabber/logprint.h>
    30 #include <mcabber/hooks.h>
    30 #include <mcabber/hooks.h>
    31 #include <mcabber/modules.h>
    31 #include <mcabber/modules.h>
    32 
    32 
    33 #include "pep.h"
    33 #include "pep.h"
    34 #include "mood.h"
    34 #include "pep_mood.h"
    35 
    35 
    36 #include "config.h"
    36 #include "config.h"
    37 
    37 
    38 //
    38 //
    39 //  module description
    39 //  module description
    40 //
    40 //
    41 
    41 
    42 void pep_mood_init   (void);
    42 void pep_mood_init   (void);
    43 void pep_mood_uninit (void);
    43 void pep_mood_uninit (void);
    44 
    44 
    45 #define DESCRIPTION ( "PEP mood events handling" )
    45 #define DESCRIPTION ( PEP_MOOD_DESCRIPTION )
    46 
    46 
    47 static const gchar *deps[] = { "pep", NULL };
    47 static const gchar *deps[] = { "pep", NULL };
    48 
    48 
    49 static module_info_t info_mood_dev = {
    49 static module_info_t info_mood_dev = {
    50 	.branch      = "dev",
    50 	.branch      = "dev",
   116 	}
   116 	}
   117 
   117 
   118 	return LM_HANDLER_RESULT_REMOVE_MESSAGE;
   118 	return LM_HANDLER_RESULT_REMOVE_MESSAGE;
   119 }
   119 }
   120 
   120 
   121 void mood_publish (const gchar *mood, const gchar *text)
   121 static void mood_publish (const gchar *mood, const gchar *text)
   122 {
   122 {
   123 	if (!xmpp_is_online ()) {
   123 	if (!xmpp_is_online ()) {
   124 		scr_log_print (LPRINT_DEBUG, "mood: Delaying publish until online.");
   124 		scr_log_print (LPRINT_DEBUG, "mood: Delaying publish until online.");
   125 
   125 
   126 		g_free (delayed_mood);
   126 		g_free (delayed_mood);
   165 	}
   165 	}
   166 
   166 
   167 	lm_message_unref (request);
   167 	lm_message_unref (request);
   168 }
   168 }
   169 
   169 
   170 gboolean mood_request ( const gchar *to, GError **err )
   170 gboolean pep_mood_request ( const gchar *to, GError **err )
   171 {
   171 {
   172 	LmMessage *request;
   172 	LmMessage *request;
   173 	LmMessageNode *node;
   173 	LmMessageNode *node;
   174 	
   174 	
   175 	if (!xmpp_is_online ()) {
   175 	if (!xmpp_is_online ()) {