Move another message into the only file its used.
authorWilfried Goesgens <dothebart@citadel.org>
Tue, 4 Aug 2015 20:12:04 +0000 (22:12 +0200)
committerWilfried Goesgens <dothebart@citadel.org>
Tue, 4 Aug 2015 20:12:04 +0000 (22:12 +0200)
citadel/modules/network/serv_netspool.c
citadel/modules/network/serv_network.c
citadel/modules/network/serv_network.h

index df1c225dfa0846686281608c87c09c2574842fdf..04144b54267317ffc1303d8aed8ddd090a3dbbe0 100644 (file)
 #endif
 
 
+/*
+ * Bounce a message back to the sender
+ */
+void network_bounce(struct CtdlMessage *msg, char *reason)
+{
+       struct CitContext *CCC = CC;
+       char buf[SIZ];
+       char bouncesource[SIZ];
+       char recipient[SIZ];
+       recptypes *valid = NULL;
+       char force_room[ROOMNAMELEN];
+       static int serialnum = 0;
+       long len;
+
+       QNM_syslog(LOG_DEBUG, "entering network_bounce()\n");
+
+       if (msg == NULL) return;
+
+       snprintf(bouncesource, sizeof bouncesource, "%s@%s", BOUNCESOURCE, config.c_nodename);
+
+       /* 
+        * Give it a fresh message ID
+        */
+       len = snprintf(buf, sizeof(buf),
+                      "%ld.%04lx.%04x@%s",
+                      (long)time(NULL),
+                      (long)getpid(),
+                      ++serialnum,
+                      config.c_fqdn);
+
+       CM_SetField(msg, emessageId, buf, len);
+
+       /*
+        * FIXME ... right now we're just sending a bounce; we really want to
+        * include the text of the bounced message.
+        */
+       CM_SetField(msg, eMesageText, reason, strlen(reason));
+       msg->cm_format_type = 0;
+
+       /*
+        * Turn the message around
+        */
+       CM_FlushField(msg, eRecipient);
+       CM_FlushField(msg, eDestination);
+
+       len = snprintf(recipient, sizeof(recipient), "%s@%s",
+                      msg->cm_fields[eAuthor],
+                      msg->cm_fields[eNodeName]);
+
+       CM_SetField(msg, eAuthor, HKEY(BOUNCESOURCE));
+       CM_SetField(msg, eNodeName, CFG_KEY(c_nodename));
+       CM_SetField(msg, eMsgSubject, HKEY("Delivery Status Notification (Failure)"));
+
+       Netmap_AddMe(msg, HKEY("unknown_user"));
+
+       /* Now submit the message */
+       valid = validate_recipients(recipient, NULL, 0);
+       if (valid != NULL) if (valid->num_error != 0) {
+               free_recipients(valid);
+               valid = NULL;
+       }
+       if ( (valid == NULL) || (!strcasecmp(recipient, bouncesource)) ) {
+               strcpy(force_room, config.c_aideroom);
+       }
+       else {
+               strcpy(force_room, "");
+       }
+       if ( (valid == NULL) && IsEmptyStr(force_room) ) {
+               strcpy(force_room, config.c_aideroom);
+       }
+       CtdlSubmitMsg(msg, valid, force_room, 0);
+
+       /* Clean up */
+       if (valid != NULL) free_recipients(valid);
+       CM_Free(msg);
+       QNM_syslog(LOG_DEBUG, "leaving network_bounce()\n");
+}
+
+
 void ParseLastSent(const CfgLineType *ThisOne, StrBuf *Line, const char *LinePos, OneRoomNetCfg *OneRNCFG)
 {
        RoomNetCfgLine *nptr;
index c61d225931a36b6327205295d10d90c1eb548f86..c6ca869da4b9946342b3dd6fbc14028a4a18e80a 100644 (file)
@@ -292,87 +292,6 @@ void destroy_network_queue_room_locked (void)
 }
 
 
-
-/*
- * Bounce a message back to the sender
- */
-void network_bounce(struct CtdlMessage *msg, char *reason)
-{
-       struct CitContext *CCC = CC;
-       char buf[SIZ];
-       char bouncesource[SIZ];
-       char recipient[SIZ];
-       recptypes *valid = NULL;
-       char force_room[ROOMNAMELEN];
-       static int serialnum = 0;
-       long len;
-
-       QNM_syslog(LOG_DEBUG, "entering network_bounce()\n");
-
-       if (msg == NULL) return;
-
-       snprintf(bouncesource, sizeof bouncesource, "%s@%s", BOUNCESOURCE, config.c_nodename);
-
-       /* 
-        * Give it a fresh message ID
-        */
-       len = snprintf(buf, sizeof(buf),
-                      "%ld.%04lx.%04x@%s",
-                      (long)time(NULL),
-                      (long)getpid(),
-                      ++serialnum,
-                      config.c_fqdn);
-
-       CM_SetField(msg, emessageId, buf, len);
-
-       /*
-        * FIXME ... right now we're just sending a bounce; we really want to
-        * include the text of the bounced message.
-        */
-       CM_SetField(msg, eMesageText, reason, strlen(reason));
-       msg->cm_format_type = 0;
-
-       /*
-        * Turn the message around
-        */
-       CM_FlushField(msg, eRecipient);
-       CM_FlushField(msg, eDestination);
-
-       len = snprintf(recipient, sizeof(recipient), "%s@%s",
-                      msg->cm_fields[eAuthor],
-                      msg->cm_fields[eNodeName]);
-
-       CM_SetField(msg, eAuthor, HKEY(BOUNCESOURCE));
-       CM_SetField(msg, eNodeName, CFG_KEY(c_nodename));
-       CM_SetField(msg, eMsgSubject, HKEY("Delivery Status Notification (Failure)"));
-
-       Netmap_AddMe(msg, HKEY("unknown_user"));
-
-       /* Now submit the message */
-       valid = validate_recipients(recipient, NULL, 0);
-       if (valid != NULL) if (valid->num_error != 0) {
-               free_recipients(valid);
-               valid = NULL;
-       }
-       if ( (valid == NULL) || (!strcasecmp(recipient, bouncesource)) ) {
-               strcpy(force_room, config.c_aideroom);
-       }
-       else {
-               strcpy(force_room, "");
-       }
-       if ( (valid == NULL) && IsEmptyStr(force_room) ) {
-               strcpy(force_room, config.c_aideroom);
-       }
-       CtdlSubmitMsg(msg, valid, force_room, 0);
-
-       /* Clean up */
-       if (valid != NULL) free_recipients(valid);
-       CM_Free(msg);
-       QNM_syslog(LOG_DEBUG, "leaving network_bounce()\n");
-}
-
-
-
 /*
  * network_do_queue()
  * 
index 7116eba8b0244943dcf8904bc9952ed3900a28e5..e23918e18dfba5f50412f264297e53145512f9ea 100644 (file)
@@ -39,5 +39,4 @@ void load_network_filter_list(void);
 
 void network_queue_room(struct ctdlroom *, void *);
 ////void destroy_network_queue_room(void);
-void network_bounce(struct CtdlMessage *msg, char *reason);