* Added a GTSN (GeT list of SeeN messages) command
authorArt Cancro <ajc@citadel.org>
Thu, 23 May 2002 03:33:23 +0000 (03:33 +0000)
committerArt Cancro <ajc@citadel.org>
Thu, 23 May 2002 03:33:23 +0000 (03:33 +0000)
citadel/ChangeLog
citadel/citserver.c
citadel/msgbase.c
citadel/msgbase.h
citadel/techdoc/session.txt
citadel/user_ops.c

index 2cea16d48f4660d0188473b0d78e5b097386e98a..4a2514f8a8f24b7871739d68adf13c6314792ae6 100644 (file)
@@ -1,4 +1,7 @@
  $Log$
+ Revision 591.30  2002/05/23 03:33:21  ajc
+ * Added a GTSN (GeT list of SeeN messages) command
+
  Revision 591.29  2002/05/20 14:29:59  ajc
  * commands.c: fixed bug in the scan for idle_threshold= which didn't include
    the = sign and ended up always setting this value to 0
@@ -3672,3 +3675,4 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant <bryant@cs.usm.maine.edu>
 
 Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
        * Initial CVS import
+
index 023d34a5f7d936a7ff373e411e2181690132bc49..78a0e7e79aba8a1e9a78e858079cc4cff0ab75a2 100644 (file)
@@ -1227,6 +1227,10 @@ void do_command_loop(void) {
                cmd_seen(&cmdbuf[5]);
        }
 
+       else if (!strncasecmp(cmdbuf, "GTSN", 4)) {
+               cmd_gtsn(&cmdbuf[5]);
+       }
+
        else if (!strncasecmp(cmdbuf, "VIEW", 4)) {
                cmd_view(&cmdbuf[5]);
        }
index 42e6e292aa9743e187c8db6a210588dc74e78e8a..819b98849825158bd02d44d33f1fae852f2f263b 100644 (file)
@@ -284,6 +284,21 @@ int CtdlMsgCmp(struct CtdlMessage *msg, struct CtdlMessage *template) {
 }
 
 
+
+/*
+ * Retrieve the "seen" message list for the current room.
+ */
+void CtdlGetSeen(char *buf) {
+       struct visit vbuf;
+
+       /* Learn about the user and room in question */
+       CtdlGetRelationship(&vbuf, &CC->usersupp, &CC->quickroom);
+
+       safestrncpy(buf, vbuf.v_seen, SIZ);
+}
+
+
+
 /*
  * Manipulate the "seen msgs" string.
  */
@@ -300,8 +315,6 @@ void CtdlSetSeen(long target_msgnum, int target_setting) {
        int num_msgs = 0;
 
        /* Learn about the user and room in question */
-       get_mm();
-       getuser(&CC->usersupp, CC->curr_user);
        CtdlGetRelationship(&vbuf, &CC->usersupp, &CC->quickroom);
 
        /* Load the message list */
index 9edb221cc5f4a335808408c97865b908340c8463..81754118457baa33af9165eea45c5a74d76c52b0 100644 (file)
@@ -117,3 +117,4 @@ int CtdlDoIHavePermissionToDeleteMessagesFromThisRoom(void);
 int CtdlDoIHavePermissionToPostInThisRoom(char *errmsgbuf, size_t n);
 void CtdlSetSeen(long target_msgnum, int target_setting);
 struct recptypes *validate_recipients(char *recipients);
+void CtdlGetSeen(char *buf);
index 494fdef8c37f5b756f65b9b605d1f9e9d1a56fa3..b9f4151db66fd303086feea6afdb654143324a1e 100644 (file)
@@ -1824,6 +1824,12 @@ done on the supplied data; if the requested message does not exist, the SEEN
 command simply returns OK without doing anything.
  
  
+ GTSN   (GeT the list of SeeN messages)
+ This command retrieves the list of "seen" (as opposed to unread) messages for
+the current room.  It returns OK followed by an IMAP-format message list.
  SMTP   (utility commands for the SMTP gateway)
  
  This command, accessible only by Aides, supports several utility operations
index c6621951557fc57f6ffbea70a291eda2fa5c143f..5c8b843b2fb5b3bd7386e8bdc2e9e9da00a333ec 100644 (file)
@@ -978,6 +978,19 @@ void cmd_seen(char *argbuf) {
 }
 
 
+void cmd_gtsn(char *argbuf) {
+       char buf[SIZ];
+
+       if (CtdlAccessCheck(ac_logged_in)) {
+               return;
+       }
+
+       CtdlGetSeen(buf);
+       cprintf("%d %s\n", buf);
+}
+
+
+
 /*
  * INVT and KICK commands
  */