-void *answerscripts_process_message(void *conv) {
- FILE* pipe = popen(hook_script, "r"); //TODO: process scripts and send response asynchronously
- while (pipe && fgets(response, RESPONSE_LINE_LENGTH, pipe)) {
+typedef struct {
+ FILE *pipe;
+ PurpleConversation *conv;
+} answerscripts_job;
+
+int answerscripts_process_message(answerscripts_job *job) {
+ //TODO: process scripts and send response asynchronously
+ FILE *pipe = job->pipe;
+ PurpleConversation *conv = job->conv;
+
+ if (pipe && fgets(response, ANSWERSCRIPTS_LINE_LENGTH, pipe)) {