* Rewrite m<Y> next function; now uses CtdlIPC code.
authorMichael Hampton <io_error@uncensored.citadel.org>
Mon, 1 Mar 2004 17:33:30 +0000 (17:33 +0000)
committerMichael Hampton <io_error@uncensored.citadel.org>
Mon, 1 Mar 2004 17:33:30 +0000 (17:33 +0000)
citadel/ChangeLog
citadel/messages.c

index 71fc242cf431ac825a041588008dbd11978c6259..0d769d760bb2f8ef769f6367a7bccfa8aabacbfd 100644 (file)
@@ -1,4 +1,7 @@
  $Log$
+ Revision 614.59  2004/03/01 17:33:30  error
+ * Rewrite m<Y> next function; now uses CtdlIPC code.
+
  Revision 614.58  2004/03/01 04:08:34  ajc
  * Revoke access to room when /kicked
 
@@ -5434,4 +5437,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 1e7bdb394a52fbac9f91157b2d7d09607293121f..160be8632ff950a771e251f2578ea5584b90bbcc 100644 (file)
@@ -1813,30 +1813,24 @@ RMSGREAD:       scr_flush();
             int lasta = a;
             for (finda = a; ((finda < num_msgs) && (finda >= 0)); finda += rdir)
               {
-                /* This is repetitively dumb, but that's what computers are for.
-                   We have to load up messages until we find one by us */
-                char buf[SIZ];
-                int founda = 0;
+               /* This is repetitively dumb, but that's what computers are for.
+                  We have to load up messages until we find one by us */
+               char buf[SIZ];
+               int founda = 0;
+               struct ctdlipcmessage *msg;
                 
                /* read the header so we can get 'from=' */
-                       snprintf(buf, sizeof buf, "MSG0 %ld|1", msg_arr[finda]);
-               CtdlIPC_putline(ipc, buf);
-               CtdlIPC_getline(ipc, buf);
-               while (CtdlIPC_getline(ipc, buf), strcmp(buf, "000")) 
-                  {
-                       if ((!strncasecmp(buf, "from=", 5)) && (finda != a)) /* Skip current message. */
-                     { 
-                        if (strcasecmp(buf+5, fullname) == 0)
-                          {
-                            a = lasta; /* meesa current */
-                            founda = 1;
-                          }
-                         }
-                 }
-                   /* we are now in synch with the server */
-                if (founda)
-                  break; /* for */
-                lasta = finda; /* keep one behind or we skip on the reentrance to the for */
+               r = CtdlIPCGetSingleMessage(ipc, msg_arr[finda], 1, 0, &msg, buf);
+               if (!strncasecmp(msg->author, fullname)) {
+                       a = lasta; /* meesa current */
+                       founda = 1;
+               }
+
+               free(msg);
+
+               if (founda)
+                       break; /* for */
+               lasta = finda; /* keep one behind or we skip on the reentrance to the for */
               } /* for */
           } /* case 'y' */
       } /* switch */