X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=citadel%2Faidepost.c;h=7b637f548233be8400ce3e426b7dabbe526d8794;hb=4eb74b26380dfde31c86c685f0589e0c653aebf0;hp=71502756a3660f7ec378f52d05bcb31fc8bd0276;hpb=b7dc265b228b8da7a5beab3114ac1794fa7a813e;p=citadel.git diff --git a/citadel/aidepost.c b/citadel/aidepost.c index 71502756a..7b637f548 100644 --- a/citadel/aidepost.c +++ b/citadel/aidepost.c @@ -2,6 +2,22 @@ * $Id$ * * This is just a little hack to copy standard input to a message in Aide> + * + * Copyright (c) 1987-2009 by the citadel.org team + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include @@ -34,14 +50,14 @@ /* * Simplified function to generate a message in our format */ -static void ap_make_message(FILE *fp, char *target_room, char *author) +static void ap_make_message(FILE *fp, char *target_room, char *author, char *subject) { int a; long bb, cc; time_t now; time(&now); putc(255, fp); - putc(MT_RFC822, fp); + putc(MES_NORMAL, fp); putc(1, fp); fprintf(fp, "Proom_aide"); putc(0, fp); @@ -51,6 +67,9 @@ static void ap_make_message(FILE *fp, char *target_room, char *author) putc(0, fp); fprintf(fp, "O%s", target_room); putc(0, fp); + if (strlen(subject) > 0) { + fprintf(fp, "U%s%c", subject, 0); + } fprintf(fp, "N%s", NODENAME); putc(0, fp); putc('M', fp); @@ -74,6 +93,7 @@ int main(int argc, char **argv) char tempspool[64]; char target_room[ROOMNAMELEN]; char author[64]; + char subject[256]; FILE *tempfp, *spoolfp; int ch; int i; @@ -84,13 +104,14 @@ int main(int argc, char **argv) char ctdldir[PATH_MAX]=CTDLDIR; /* TODO: should we be able to calculate relative dirs? */ - calc_dirs_n_files(relh, home, relhome, ctdldir); + calc_dirs_n_files(relh, home, relhome, ctdldir, 0); get_config(); strcpy(target_room, "Aide"); strcpy(author, "Citadel"); + strcpy(subject, ""); for (i=1; i