Experimental fix to avoid sending empty messages sometimes without any reason
[mirrors/libpurple-core-answerscripts.git] / answerscripts.c
index a85717e..25d6cd6 100755 (executable)
@@ -40,7 +40,7 @@ typedef struct {
 
 int answerscripts_process_message_cb(answerscripts_job *job) {
        int i;
-       char response[ANSWERSCRIPTS_LINE_LENGTH+1];
+       char response[ANSWERSCRIPTS_LINE_LENGTH+1]; response[0]='\0';
        FILE *pipe = job->pipe;
        PurpleConversation *conv = job->conv;
 
@@ -50,7 +50,7 @@ int answerscripts_process_message_cb(answerscripts_job *job) {
                ) return 1;
 
                for(i=0;response[i];i++) if(response[i]=='\n') response[i]=0;
-               purple_conv_im_send(purple_conversation_get_im_data(conv), response);
+               if(response[0]!='\0') purple_conv_im_send(purple_conversation_get_im_data(conv), response);
 
                if(!feof(pipe)) return 1;
        }
This page took 0.13094 seconds and 4 git commands to generate.