* Added BMBX to fix a problem
authorArt Cancro <ajc@citadel.org>
Sat, 9 Mar 2002 16:48:00 +0000 (16:48 +0000)
committerArt Cancro <ajc@citadel.org>
Sat, 9 Mar 2002 16:48:00 +0000 (16:48 +0000)
citadel/ChangeLog
citadel/citserver.h
citadel/serv_network.c
citadel/serv_network.h
citadel/serv_upgrade.c
citadel/techdoc/session.txt

index a5b446573400876ea28fb7bc75e7ebbdc78294a1..f146872751c5336e1ca91a8f296878ddfaa3c6ba 100644 (file)
@@ -1,4 +1,7 @@
  $Log$
+ Revision 590.133  2002/03/09 16:47:57  ajc
+ * Added BMBX to fix a problem
+
  Revision 590.132  2002/03/09 06:18:37  ajc
  * one more tweak
 
@@ -3408,4 +3411,3 @@ 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 5b4f7bc1e3f9adfe4e442bcf9f8a86620f2cf01a..24531928043c0fa42aec6cfd747d75fbc998d023 100644 (file)
@@ -2,6 +2,12 @@
 
 #include "dynloader.h"
 
+/* Simple linked list structure ... used in a bunch of different places. */
+struct RoomProcList {
+        struct RoomProcList *next;
+        char name[ROOMNAMELEN];
+};
+
 void master_startup (void);
 void master_cleanup (void);
 void RemoveContext (struct CitContext *);
index 9b92016c9cb0c61602ff79dd620422c682ca5d2a..02dc5e2357e5d0d8fe6636cbb304e2e619674333 100644 (file)
@@ -1363,6 +1363,8 @@ void cmd_netp(char *cmdbuf)
 
 
 
+
+
 /*
  * Module entry point
  */
index ed65e04bbbcc0153704cae7a9f1841674cf1aa2f..9ff68ea97655fb35a86e011b6154b902c127d341 100644 (file)
@@ -9,11 +9,6 @@ struct SpoolControl {
        struct namelist *ignet_push_shares;
 };
 
-struct RoomProcList {
-        struct RoomProcList *next;
-        char name[ROOMNAMELEN];
-};
-
 struct NetMap {
        struct NetMap *next;
        char nodename[SIZ];
index 1b03efb2f66a8a0af3f97febf05f212c1c01b96a..1a6323d4f6344dc3d25285d25417b5607c5ab01f 100644 (file)
 #include "control.h"
 #include "dynloader.h"
 #include "database.h"
+#include "room_ops.h"
 #include "user_ops.h"
 #include "msgbase.h"
+#include "tools.h"
 #include "serv_upgrade.h"
 
 void do_pre555_usersupp_upgrade(void) {
@@ -152,8 +154,94 @@ void check_server_upgrades(void) {
 
 
 
+
+
+
+
+
+
+
+/* 
+ * Back end processing function for cmd_bmbx
+ */
+void cmd_bmbx_backend(struct quickroom *qrbuf, void *data) {
+       static struct RoomProcList *rplist = NULL;
+       struct RoomProcList *ptr;
+       struct quickroom qr;
+
+       /* Lazy programming here.  Call this function as a ForEachRoom backend
+        * in order to queue up the room names, or call it with a null room
+        * to make it do the processing.
+        */
+       if (qrbuf != NULL) {
+               ptr = (struct RoomProcList *)
+                       mallok(sizeof (struct RoomProcList));
+               if (ptr == NULL) return;
+
+               safestrncpy(ptr->name, qrbuf->QRname, sizeof ptr->name);
+               ptr->next = rplist;
+               rplist = ptr;
+               return;
+       }
+
+       while (rplist != NULL) {
+
+               if (lgetroom(&qr, rplist->name) == 0) {
+                       lprintf(9, "Processing <%s>...\n", rplist->name);
+                       if ( (qr.QRflags & QR_MAILBOX) == 0) {
+                               lprintf(9, "  -- not a mailbox\n");
+                       }
+                       else {
+
+                               qr.QRgen = time(NULL);
+                               lprintf(9, "  -- bumped!\n");
+                       }
+                       lputroom(&qr);
+               }
+
+               ptr = rplist;
+               rplist = rplist->next;
+               phree(ptr);
+       }
+}
+
+/*
+ * quick fix command to bump mailbox generation numbers
+ */
+void cmd_bmbx(char *argbuf) {
+       int really_do_this  = 0;
+
+       if (CtdlAccessCheck(ac_internal)) return;
+       really_do_this = extract_int(argbuf, 0);
+
+       if (really_do_this != 1) {
+               cprintf("%d You didn't really want to do that.\n", OK);
+               return;
+       }
+
+       ForEachRoom(cmd_bmbx_backend, NULL);
+       cmd_bmbx_backend(NULL, NULL);
+
+       cprintf("%d Mailbox generation numbers bumped.\n", OK);
+       return;
+
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
 char *Dynamic_Module_Init(void)
 {
        check_server_upgrades();
+       CtdlRegisterProtoHook(cmd_bmbx, "BMBX", "Bump mailboxes");
        return "$Id$";
 }
index 3860b60b2241ca8648c1a97331acfe7d205573d7..36fb5c10952431b8e76f538d6379c5904beaf571 100644 (file)
@@ -1897,6 +1897,11 @@ returns OK followed by a Citadel address if there is a match, otherwise it
 returns ERROR+NOT_LOGGED_IN.
  
  
+ BMBX   (Bump MailBoX generation numbers)
+ This is a sooper-seekrit undocumented command.
+  
+  
  ASYN   (ASYNchronous message support)
  
  Negotiate the use of asynchronous, or unsolicited, protocol messages.  The