]> code.citadel.org Git - citadel.git/blobdiff - citadel/modules/network/serv_network.c
merge hickups. TBC.
[citadel.git] / citadel / modules / network / serv_network.c
index a5492eb69ed74b1eed4537d6fc4c8fba6b06c3c9..4518740bf1ac9d00754940659cfbe3070abb6f5b 100644 (file)
@@ -712,26 +712,17 @@ void network_spool_msg(long msgnum, void *userdata) {
                                msg->cm_fields['U'] = strdup("(no subject)");
                        }
                        
-                       len = strlen(msg->cm_fields['U']);
-                       pCh = strstr(msg->cm_fields['U'], CC->room.QRname);
+                       len  = strlen(msg->cm_fields['U']);
+                       rlen = strlen(CC->room.QRname);
+                       pCh  = strstr(msg->cm_fields['U'], CC->room.QRname);
                        if ((pCh == NULL) ||
-                           (*(pCh + len) != ']') ||
+                           (*(pCh + rlen) != ']') ||
                            (pCh == msg->cm_fields['U']) ||
                            (*(pCh - 1) != '[')
                                )
                        {
                                char *pBuff;
 
-                               rlen = strlen(CC->room.QRname);
-                               rlen += len + 4;
-                               pBuff = malloc (rlen * sizeof(char));
-
-                               snprintf(pBuff, rlen, "[%s] %s", CC->room.QRname, msg->cm_fields['U']);
-                               free(msg->cm_fields['U']);
-                               msg->cm_fields['U'] = pBuff;
-                       }
-                       /* else we won't modify the buffer, since the roomname is already here. */
-
                                rlen += len + 4;
                                pBuff = malloc (rlen * sizeof(char));