]> code.citadel.org Git - citadel.git/blobdiff - citadel/euidindex.c
Replaced some of the 'autoconverted - document me' strings
[citadel.git] / citadel / euidindex.c
index 2dac3730fd79a66e1e509d4f8164fe73abc20303..a39881bac6adafcc6849ce30955f9316c6483ec0 100644 (file)
@@ -1,8 +1,5 @@
 /*
- * $Id$
- *
  * Index messages by EUID per room.
- *
  */
 
 #include "sysdep.h"
@@ -72,6 +69,7 @@ int DoesThisRoomNeedEuidIndexing(struct ctdlroom *qrbuf) {
                case VIEW_BBS:          return(0);
                case VIEW_MAILBOX:      return(0);
                case VIEW_ADDRESSBOOK:  return(1);
+               case VIEW_DRAFTS:       return(0);
                case VIEW_CALENDAR:     return(1);
                case VIEW_TASKS:        return(1);
                case VIEW_NOTES:        return(1);
@@ -91,6 +89,10 @@ int DoesThisRoomNeedEuidIndexing(struct ctdlroom *qrbuf) {
  * its message number.
  */
 long locate_message_by_euid(char *euid, struct ctdlroom *qrbuf) {
+       return CtdlLocateMessageByEuid (euid, qrbuf);
+}
+
+long CtdlLocateMessageByEuid(char *euid, struct ctdlroom *qrbuf) {
        char *key;
        int key_len;
        struct cdbdata *cdb_euid;
@@ -171,7 +173,7 @@ void rebuild_euid_index_for_room(struct ctdlroom *qrbuf, void *data) {
        struct RoomProcList *ptr;
        struct ctdlroom qr;
 
-       /* Lazy programming here.  Call this function as a ForEachRoom backend
+       /* Lazy programming here.  Call this function as a CtdlForEachRoom backend
         * in order to queue up the room names, or call it with a null room
         * to make it do the processing.
         */
@@ -187,12 +189,12 @@ void rebuild_euid_index_for_room(struct ctdlroom *qrbuf, void *data) {
        }
 
        while (rplist != NULL) {
-               if (getroom(&qr, rplist->name) == 0) {
+               if (CtdlGetRoom(&qr, rplist->name) == 0) {
                        if (DoesThisRoomNeedEuidIndexing(&qr)) {
                                CtdlLogPrintf(CTDL_DEBUG,
                                        "Rebuilding EUID index for <%s>\n",
                                        rplist->name);
-                               usergoto(rplist->name, 0, 0, NULL, NULL);
+                               CtdlUserGoto(rplist->name, 0, 0, NULL, NULL);
                                CtdlForEachMessage(MSGS_ALL, 0L, NULL, NULL, NULL,
                                        rebuild_euid_index_for_msg, NULL);
                        }
@@ -209,7 +211,7 @@ void rebuild_euid_index_for_room(struct ctdlroom *qrbuf, void *data) {
  */
 void rebuild_euid_index(void) {
        cdb_trunc(CDB_EUIDINDEX);               /* delete the old indices */
-       ForEachRoom(rebuild_euid_index_for_room, NULL); /* enumerate rm names */
+       CtdlForEachRoom(rebuild_euid_index_for_room, NULL);     /* enumerate rm names */
        rebuild_euid_index_for_room(NULL, NULL);        /* and index them */
 }
 
@@ -229,7 +231,7 @@ void cmd_euid(char *cmdbuf) {
        if (CtdlAccessCheck(ac_logged_in)) return;
 
        extract_token(euid, cmdbuf, 0, '|', sizeof euid);
-       msgnum = locate_message_by_euid(euid, &CC->room);
+       msgnum = CtdlLocateMessageByEuid(euid, &CC->room);
        if (msgnum <= 0L) {
                cprintf("%d not found\n", ERROR + MESSAGE_NOT_FOUND);
                return;
@@ -254,7 +256,9 @@ void cmd_euid(char *cmdbuf) {
 
 CTDL_MODULE_INIT(euidindex)
 {
-       CtdlRegisterProtoHook(cmd_euid, "EUID", "Autoconverted. TODO: document me.");
+       if (!threading) {
+               CtdlRegisterProtoHook(cmd_euid, "EUID", "Perform operations on Extended IDs for messages");
+       }
        /* return our Subversion id for the Log */
-       return "$Id$";
+       return "euidindex";
 }