* New API function CtdlDoIHavePermissionToReadMessagesInThisRoom()
authorArt Cancro <ajc@citadel.org>
Wed, 21 Oct 2009 16:42:59 +0000 (16:42 +0000)
committerArt Cancro <ajc@citadel.org>
Wed, 21 Oct 2009 16:42:59 +0000 (16:42 +0000)
citadel/modules/wiki/serv_wiki.c
citadel/msgbase.c
citadel/msgbase.h

index 1e6a917a6e7d56442abb8ee9619e70d98b747e7d..522775c4b95ad5a087a3a769f60173fe20f2671a 100644 (file)
@@ -297,6 +297,8 @@ int wiki_upload_beforesave(struct CtdlMessage *msg) {
  */
 void cmd_wiki(char *argbuf) {
        cprintf("%d FIXME not finished\n", ERROR);
+
+       /* mime_parser(mptr, NULL, *mime_download, NULL, NULL, NULL, 0); */
 }
 
 
index d46ec6cf6814fbf7dd3c990eb160c0a5b33da733..c90ef0e2c28c2bd0392da2e4d1c586ec46c6a6af 100644 (file)
@@ -1431,6 +1431,16 @@ void extract_encapsulated_message(char *name, char *filename, char *partnum, cha
 
 
 
+
+
+int CtdlDoIHavePermissionToReadMessagesInThisRoom(void) {
+       if ((!(CC->logged_in)) && (!(CC->internal_pgm))) {
+               return(om_not_logged_in);
+       }
+       return(om_ok);
+}
+
+
 /*
  * Get a message off disk.  (returns om_* values found in msgbase.h)
  * 
@@ -1446,16 +1456,24 @@ int CtdlOutputMsg(long msg_num,         /* message number (local) to fetch */
        struct CtdlMessage *TheMessage = NULL;
        int retcode = om_no_such_msg;
        struct encapmsg encap;
+       int r;
 
-       CtdlLogPrintf(CTDL_DEBUG, "CtdlOutputMsg() msgnum=%ld, mode=%d, section=%s\n", 
+       CtdlLogPrintf(CTDL_DEBUG, "CtdlOutputMsg(msgnum=%ld, mode=%d, section=%s)\n", 
                msg_num, mode,
                (section ? section : "<>")
        );
 
-       if ((!(CC->logged_in)) && (!(CC->internal_pgm))) {
-               if (do_proto) cprintf("%d Not logged in.\n",
-                       ERROR + NOT_LOGGED_IN);
-               return(om_not_logged_in);
+       r = CtdlDoIHavePermissionToReadMessagesInThisRoom();
+       if (r != om_ok) {
+               if (do_proto) {
+                       if (r == om_not_logged_in) {
+                               cprintf("%d Not logged in.\n", ERROR + NOT_LOGGED_IN);
+                       }
+                       else {
+                               cprintf("%d An unknown error has occurred.\n", ERROR);
+                       }
+               }
+               return(r);
        }
 
        /* FIXME: check message id against msglist for this room */
index beced22efd3e7c7ed65aeaf45d4a5f993bfad01c..f43ee600357cdc83c3174637cf11bff86906ed2d 100644 (file)
@@ -160,11 +160,12 @@ int CtdlOutputMsg(long msg_num,           /* message number (local) to fetch */
 int CtdlOutputPreLoadedMsg(struct CtdlMessage *,
                           int mode,            /* how would you like that message? */
                           int headers_only,    /* eschew the message body? */
-                          int do_proto,                /* do Citadel protocol responses? */
+                          int do_proto,        /* do Citadel protocol responses? */
                           int crlf,            /* 0=LF, 1=CRLF */
                           int flags            /* should the bessage be exported clean? */
 );
 int CtdlDoIHavePermissionToDeleteMessagesFromThisRoom(void);
+int CtdlDoIHavePermissionToReadMessagesInThisRoom(void);
 
 enum {
        POST_LOGGED_IN,