mirror of
https://salsa.debian.org/dskoll/remind.git
synced 2026-04-17 06:48:47 +02:00
Fully implement JSONTRANSLATE daemon command.
This commit is contained in:
@@ -920,10 +920,16 @@ static void ServerWait(struct timeval *sleep_tv)
|
||||
} else if (!strcmp(cmdLine, "JSONTRANSLATE\n")) {
|
||||
if (!DaemonJSON) {
|
||||
printf("NOTE JSONTRANSLATE\n");
|
||||
} else {
|
||||
printf("{");
|
||||
PrintJSONKeyPairString("response", "translate");
|
||||
printf("\"table\":");
|
||||
}
|
||||
DumpTranslationTable(stdout, 1);
|
||||
if (!DaemonJSON) {
|
||||
printf("NOTE ENDJSONTRANSLATE\n");
|
||||
printf("\nNOTE ENDJSONTRANSLATE\n");
|
||||
} else {
|
||||
printf(",\"command\":\"JSONTRANSLATE\"}\n");
|
||||
}
|
||||
fflush(stdout);
|
||||
} else if (!strcmp(cmdLine, "REREAD\n")) {
|
||||
|
||||
@@ -161,7 +161,7 @@ DumpTranslationTable(FILE *fp, int json)
|
||||
item = hash_table_next(&TranslationTable, item);
|
||||
}
|
||||
if (json) {
|
||||
fprintf(fp, "}\n");
|
||||
fprintf(fp, "}");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user