[asterisk-commits] mmichelson: branch mmichelson/imap_consistency r131117 - /team/mmichelson/ima...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Jul 15 16:00:23 CDT 2008


Author: mmichelson
Date: Tue Jul 15 16:00:23 2008
New Revision: 131117

URL: http://svn.digium.com/view/asterisk?view=rev&rev=131117
Log:
Removing redundant code from forward_message.
Mark some really stupid-looking code with some XXX
comments


Modified:
    team/mmichelson/imap_consistency/apps/app_voicemail.c

Modified: team/mmichelson/imap_consistency/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/team/mmichelson/imap_consistency/apps/app_voicemail.c?view=diff&rev=131117&r1=131116&r2=131117
==============================================================================
--- team/mmichelson/imap_consistency/apps/app_voicemail.c (original)
+++ team/mmichelson/imap_consistency/apps/app_voicemail.c Tue Jul 15 16:00:23 2008
@@ -4334,53 +4334,6 @@
 #ifdef IMAP_STORAGE
 				char *myserveremail;
 				int attach_user_voicemail;
-				/* Need to get message content */
-				if (option_debug > 2)
-					ast_log (LOG_DEBUG, "Before mail_fetchheaders, curmsg is: %d, imap messages is %lu\n", vms->curmsg, vms->msgArray[vms->curmsg]);
-				if (vms->msgArray[vms->curmsg] == 0) {
-					ast_log (LOG_WARNING,"Trying to access unknown message\n");
-					return -1;
-				}
-
-				/* This will only work for new messages... */
-				header_content = mail_fetchheader (vms->mailstream, vms->msgArray[vms->curmsg]);
-				/* empty string means no valid header */
-				if (ast_strlen_zero(header_content)) {
-					ast_log (LOG_ERROR,"Could not fetch header for message number %ld\n",vms->msgArray[vms->curmsg]);
-					return -1;
-				}
-				/* Get header info needed by sendmail */
-				temp = get_header_by_tag(header_content, "X-Asterisk-VM-Duration:");
-				if (temp)
-					duration = atoi(temp);
-				else
-					duration = 0;
-
-				/* Attach only the first format */
-				fmt = ast_strdupa(fmt);
-				if (fmt) {
-					stringp = fmt;
-					strsep(&stringp, "|");
-				} else {
-					ast_log (LOG_ERROR,"audio format not set. Default to WAV\n");
-					fmt = "WAV";
-				}
-				if (!strcasecmp(fmt, "wav49"))
-					fmt = "WAV";
-				if (option_debug > 2)
-					ast_log (LOG_DEBUG,"**** format set to %s, vmfmts set to %s\n",fmt,vmfmts);
-				/* ast_copy_string(fmt, vmfmts, sizeof(fmt));*/
-				/* if (!ast_strlen_zero(fmt)) { */
-				snprintf(todir, sizeof(todir), "%s%s/%s/tmp", VM_SPOOL_DIR, vmtmp->context, vmtmp->mailbox);
-				make_file(vms->fn, sizeof(vms->fn), todir, vms->curmsg);
-				if (option_debug > 2)
-					ast_log (LOG_DEBUG,"Before mail_fetchstructure, message number is %ld, filename is:%s\n",vms->msgArray[vms->curmsg], vms->fn);
-				/*mail_fetchstructure (mailstream, vmArray[0], &body); */
-				mail_fetchstructure (vms->mailstream, vms->msgArray[vms->curmsg], &body);
-				save_body(body,vms,"3","gsm");
-				/* should not assume "fmt" here! */
-				save_body(body,vms,"2",fmt);
-
 				/* get destination mailbox */
 				dstvms = get_vm_state_by_mailbox(vmtmp->mailbox,0);
 				if (!dstvms) {
@@ -4397,10 +4350,11 @@
 				} else {
 					ast_log (LOG_ERROR,"Could not find state information for mailbox %s\n",vmtmp->mailbox);
 				}
-
+				/*XXX What in the name of Gandalf is the purpose of this stuff?? */
 				myserveremail = serveremail;
 				if (!ast_strlen_zero(vmtmp->serveremail))
 					myserveremail = vmtmp->serveremail;
+				/*XXX Seriously....wtf?*/
 				attach_user_voicemail = ast_test_flag((&globalflags), VM_ATTACH);
 				attach_user_voicemail = ast_test_flag(vmtmp, VM_ATTACH);
 				/* NULL category for IMAP storage */




More information about the asterisk-commits mailing list