Index: apps/app_voicemail.c
===================================================================
RCS file: /usr/cvsroot/asterisk/apps/app_voicemail.c,v
retrieving revision 1.226
diff -u -p -r1.226 app_voicemail.c
--- apps/app_voicemail.c	12 Jul 2005 02:57:50 -0000	1.226
+++ apps/app_voicemail.c	12 Jul 2005 05:40:26 -0000
@@ -3024,7 +3024,7 @@ static int forward_message(struct ast_ch
 	char callerid[512];
 	char ext_context[256]="";
 	int res = 0, cmd = 0;
-	struct ast_vm_user *receiver, *extensions = NULL, *vmtmp = NULL, *vmfree;
+	struct ast_vm_user *receiver = NULL, *extensions = NULL, *vmtmp = NULL, *vmfree;
 	char tmp[256];
 	char *stringp, *s;
 	int saved_messages = 0, found = 0;
@@ -3708,56 +3708,38 @@ static int vm_intro_en(struct ast_channe
 }
 
 /* ITALIAN syntax */
-static int vm_intro_it(struct ast_channel *chan,struct vm_state *vms)
+static int vm_intro_it(struct ast_channel *chan, struct vm_state *vms)
 {
-        /* Introduce messages they have */
-        int res;
-        if (!vms->oldmessages && !vms->newmessages) {
-		res = ast_play_and_wait(chan, "vm-no");
-		if (!res)
-			res = ast_play_and_wait(chan, "vm-message");
-        } else {
-                res = ast_play_and_wait(chan, "vm-youhave");
-        }
-        if (!res) {
-                if (vms->newmessages) {
-                        if (!res) {
-                                if ((vms->newmessages == 1)) {
-                                        res = ast_play_and_wait(chan, "digits/un");
-                                        if (!res)
-                                                res = ast_play_and_wait(chan, "vm-message");
-                                        if (!res)
-                                                res = ast_play_and_wait(chan, "vm-nuovo");
-                                } else {
-                                        res = say_and_wait(chan, vms->newmessages, chan->language);
-                                        if (!res)
-                                                res = ast_play_and_wait(chan, "vm-messages");
-                                        if (!res)
-                                                res = ast_play_and_wait(chan, "vm-nuovi");
-                                }
-                        }
-                        if (vms->oldmessages && !res)
-                                res = ast_play_and_wait(chan, "vm-and");
-                }
-                if (vms->oldmessages) {
-                        if (!res) {
-                                if (vms->oldmessages == 1) {
-                                        res = ast_play_and_wait(chan, "digits/un");
-                                        if (!res)
-                                                res = ast_play_and_wait(chan, "vm-message");
-                                        if (!res)
-                                                res = ast_play_and_wait(chan, "vm-vecchio");
-                                } else {
-                                        res = say_and_wait(chan, vms->oldmessages, chan->language);
-                                        if (!res)
-                                                res = ast_play_and_wait(chan, "vm-messages");
-                                        if (!res)
-                                                res = ast_play_and_wait(chan, "vm-vecchi");
-                                }
-                        }
-                }
-        }
-	return res;
+	/* Introduce messages they have */
+	int res;
+	if (!vms->oldmessages && !vms->newmessages)
+		res =	ast_play_and_wait(chan, "vm-no") ||
+				ast_play_and_wait(chan, "vm-message");
+	else
+		res =	ast_play_and_wait(chan, "vm-youhave");
+	if (!res && vms->newmessages) {
+		res = (vms->newmessages == 1) ?
+				ast_play_and_wait(chan, "digits/un") ||
+				ast_play_and_wait(chan, "vm-nuovo") ||
+				ast_play_and_wait(chan, "vm-message") :
+			 /* 2 or more new messages */
+				say_and_wait(chan, vms->newmessages, chan->language) ||
+				ast_play_and_wait(chan, "vm-nuovi") ||
+				ast_play_and_wait(chan, "vm-messages");
+		if (!res && vms->oldmessages)
+			res =	ast_play_and_wait(chan, "vm-and");
+	}
+	if (!res && vms->oldmessages) {
+		res = (vms->oldmessages == 1) ?
+				ast_play_and_wait(chan, "digits/un") ||
+				ast_play_and_wait(chan, "vm-vecchio") ||
+				ast_play_and_wait(chan, "vm-message") :
+			/* 2 or more old messages */
+				say_and_wait(chan, vms->oldmessages, chan->language) ||
+				ast_play_and_wait(chan, "vm-vecchi") ||
+				ast_play_and_wait(chan, "vm-messages");
+	}
+	return res ? -1 : 0;
 }
 
 /* SWEDISH syntax */
