remove typedef from struct recptypes
[citadel.git] / citadel / modules / inboxrules / serv_inboxrules.c
index b5dc6d91a4016dc5c7480bc556e29e07036be3b1..b7e01278f4d63cdb3975809c9bfd612ab9b1b4cb 100644 (file)
 #include <pwd.h>
 #include <errno.h>
 #include <sys/types.h>
-
-#if TIME_WITH_SYS_TIME
-# include <sys/time.h>
-# include <time.h>
-#else
-# if HAVE_SYS_TIME_H
-#  include <sys/time.h>
-# else
-#  include <time.h>
-# endif
-#endif
-
+#include <time.h>
 #include <sys/wait.h>
 #include <string.h>
 #include <limits.h>
@@ -218,7 +207,8 @@ struct inboxrules *deserialize_inbox_rules(char *serialized_rules) {
                        // We have a rule , now parse it
                        char rtoken[SIZ];
                        int nt = num_tokens(decoded_rule, '|');
-                       for (int t=0; t<nt; ++t) {
+                       int t = 0;
+                       for (t=0; t<nt; ++t) {
                                extract_token(rtoken, decoded_rule, t, '|', sizeof(rtoken));
                                striplt(rtoken);
                                switch(t) {
@@ -355,7 +345,7 @@ int inbox_do_redirect(struct irule *rule, long msgnum) {
                return(1);                                      // don't delete the inbox copy if this failed
        }
 
-       recptypes *valid = validate_recipients(rule->redirect_to, NULL, 0);
+       struct recptypes *valid = validate_recipients(rule->redirect_to, NULL, 0);
        if (valid == NULL) {
                syslog(LOG_WARNING, "inboxrules: inbox_do_redirect() invalid recipient <%s>", rule->redirect_to);
                return(1);                                      // don't delete the inbox copy if this failed
@@ -373,7 +363,7 @@ int inbox_do_redirect(struct irule *rule, long msgnum) {
                return(1);                                      // don't delete the inbox copy if this failed
        }
 
-       CtdlSubmitMsg(msg, valid, NULL, 0);                     // send the message to the new recipient
+       CtdlSubmitMsg(msg, valid, NULL);                        // send the message to the new recipient
        free_recipients(valid);
        CM_Free(msg);
        return(0);                                              // delete the inbox copy
@@ -836,11 +826,13 @@ int num_urip_alloc = 0;
  * Perform inbox processing for all rooms which require it
  */
 void perform_inbox_processing(void) {
+       int i = 0;
+
        if (num_urip == 0) {
                return;                                                                                 // no action required
        }
 
-       for (int i=0; i<num_urip; ++i) {
+       for (i=0; i<num_urip; ++i) {
                do_inbox_processing_for_user(users_requiring_inbox_processing[i]);
        }
 
@@ -856,6 +848,7 @@ void perform_inbox_processing(void) {
  * If it's someone's inbox, we have to check for inbox rules
  */
 int serv_inboxrules_roomhook(struct ctdlroom *room) {
+       int i = 0;
 
        // Is this someone's inbox?
        if (!strcasecmp(&room->QRname[11], MAILROOM)) {
@@ -864,7 +857,7 @@ int serv_inboxrules_roomhook(struct ctdlroom *room) {
 
                        // first check to see if this user is already on the list
                        if (num_urip > 0) {
-                               for (int i=0; i<=num_urip; ++i) {
+                               for (i=0; i<=num_urip; ++i) {
                                        if (users_requiring_inbox_processing[i] == usernum) {           // already on the list!
                                                return(0);
                                        }