]> code.citadel.org Git - citadel.git/commitdiff
* CtdlWriteObject() can now store objects in personal rooms for any specified
authorArt Cancro <ajc@citadel.org>
Wed, 29 Sep 1999 21:13:18 +0000 (21:13 +0000)
committerArt Cancro <ajc@citadel.org>
Wed, 29 Sep 1999 21:13:18 +0000 (21:13 +0000)
  user -- rather than only the current user or non-personal rooms.

citadel/ChangeLog
citadel/msgbase.c
citadel/msgbase.h
citadel/serv_icq.c
citadel/serv_vcard.c

index f1bff00312d467a6b96cd335f4f8d0a7815d568f..d69178f3721cedfd620173eb0830a9029acf681d 100644 (file)
@@ -1,4 +1,8 @@
 $Log$
+Revision 1.375  1999/09/29 21:13:17  ajc
+* CtdlWriteObject() can now store objects in personal rooms for any specified
+  user -- rather than only the current user or non-personal rooms.
+
 Revision 1.374  1999/09/29 17:26:56  ajc
 * serv_vcard.c: fixed crashola bug in cmd_greg()
 * tools.c: simplified and improved the string tokenizer.  Now it runs in a
@@ -1283,4 +1287,3 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant <bryant@cs.usm.maine.edu>
 
 Fri Jul 10 1998 Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
        * Initial CVS import 
-
index 3d1a07d66e0a775cea9e1196093c74af1a18229b..ca2d130f4e50bacd770247508643034700d9c9dc 100644 (file)
@@ -1916,7 +1916,7 @@ void AdjRefCount(long msgnum, int incr)
 void CtdlWriteObject(char *req_room,           /* Room to stuff it in */
                        char *content_type,     /* MIME type of this object */
                        char *tempfilename,     /* Where to fetch it from */
-                       int is_mailbox,         /* Private mailbox room? */
+                       struct usersupp *is_mailbox,    /* Mailbox room? */
                        int is_binary,          /* Is encoding necessary? */
                        int is_unique           /* Del others of this type? */
                        )
@@ -1931,12 +1931,11 @@ void CtdlWriteObject(char *req_room,            /* Room to stuff it in */
        struct CtdlMessage *msg;
        size_t len;
 
-       lprintf(9, "CtdlWriteObject() called\n");
-
-       if (is_mailbox)
-               MailboxName(roomname, &CC->usersupp, req_room);
+       if (is_mailbox != NULL)
+               MailboxName(roomname, is_mailbox, req_room);
        else
                safestrncpy(roomname, req_room, sizeof(roomname));
+       lprintf(9, "CtdlWriteObject() to <%s>\n", roomname);
 
        strcpy(filename, tmpnam(NULL));
        fp = fopen(filename, "w");
index cac60f9bb9868dc5e0f5a970f3bf899a2e38446c..df8dec8256d6f3bd1f5b9dcdfb5d480bd3f17f49 100644 (file)
@@ -50,7 +50,7 @@ void CtdlForEachMessage(int mode, long ref,
                        char *content_type,
                         void (*CallBack) (long msgnum) );
 int CtdlDeleteMessages(char *, long, char *);
-void CtdlWriteObject(char *, char *, char *, int, int, int);
+void CtdlWriteObject(char *, char *, char *, struct usersupp *, int, int);
 struct CtdlMessage *CtdlFetchMessage(long msgnum);
 void CtdlFreeMessage(struct CtdlMessage *msg);
 void serialize_message(struct ser_ret *, struct CtdlMessage *);
index 4e6fd24c56ad3bb6b0fdb84acd75fc3fd68194ff..9e789481540fcaf4802128dc1cd65034b02b4698 100644 (file)
@@ -1829,7 +1829,7 @@ void CtdlICQ_Write_Config(void) {
        fclose(fp);
 
        /* this handy API function does all the work for us */
-       CtdlWriteObject(ICQROOM, ICQMIME, temp, 1, 0, 1);
+       CtdlWriteObject(ICQROOM, ICQMIME, temp, &CC->usersupp, 0, 1);
 
        unlink(temp);
 }
@@ -1859,7 +1859,7 @@ void CtdlICQ_Write_CL(void) {
        fclose(fp);
 
        /* this handy API function does all the work for us */
-       CtdlWriteObject(ICQROOM, ICQCLMIME, temp, 1, 0, 1);
+       CtdlWriteObject(ICQROOM, ICQCLMIME, temp, &CC->usersupp, 0, 1);
 
        unlink(temp);
 }
index 9ba8ceb5f836ab344159ea729cb68dd1124fb608..f2c099365e8d4edb5b8cea103a2d5fad27af848f 100644 (file)
@@ -133,7 +133,6 @@ void vcard_write_user(struct usersupp *u, struct vCard *v) {
         char temp[PATH_MAX];
         FILE *fp;
        char *ser;
-        char config_rm[ROOMNAMELEN];
 
         strcpy(temp, tmpnam(NULL));
        ser = vcard_serialize(v);
@@ -149,9 +148,8 @@ void vcard_write_user(struct usersupp *u, struct vCard *v) {
        }
         fclose(fp);
 
-        /* these handy API functions do all the work for us */
-        MailboxName(config_rm, u, CONFIGROOM);
-        CtdlWriteObject(config_rm, "text/x-vcard", temp, 1, 0, 1);
+        /* This handy API function does all the work for us */
+        CtdlWriteObject(CONFIGROOM, "text/x-vcard", temp, u, 0, 1);
 
         unlink(temp);
 }