[asterisk-commits] mmichelson: branch 1.6.1 r157563 - in /branches/1.6.1: ./ apps/app_voicemail.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Nov 18 17:28:54 CST 2008


Author: mmichelson
Date: Tue Nov 18 17:28:54 2008
New Revision: 157563

URL: http://svn.digium.com/view/asterisk?view=rev&rev=157563
Log:
Merged revisions 157562 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

........
r157562 | mmichelson | 2008-11-18 17:28:23 -0600 (Tue, 18 Nov 2008) | 11 lines

Fix the logic for when delete=yes when IMAP storage
is in use so that the message is deleted from both
local and IMAP storage.

(closes issue #13642)
Reported by: jaroth
Patches:
      deleteyes.patch uploaded by jaroth (license 50)



........

Modified:
    branches/1.6.1/   (props changed)
    branches/1.6.1/apps/app_voicemail.c

Propchange: branches/1.6.1/
------------------------------------------------------------------------------
Binary property 'trunk-merged' - no diff available.

Modified: branches/1.6.1/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/branches/1.6.1/apps/app_voicemail.c?view=diff&rev=157563&r1=157562&r2=157563
==============================================================================
--- branches/1.6.1/apps/app_voicemail.c (original)
+++ branches/1.6.1/apps/app_voicemail.c Tue Nov 18 17:28:54 2008
@@ -151,6 +151,7 @@
 static void imap_mailbox_name(char *spec, size_t len, struct vm_state *vms, int box, int target);
 static int imap_store_file(char *dir, char *mailboxuser, char *mailboxcontext, int msgnum, struct ast_channel *chan, struct ast_vm_user *vmu, char *fmt, int duration, struct vm_state *vms, const char *flag);
 static void update_messages_by_imapuser(const char *user, unsigned long number);
+static int vm_delete(char *file);
 
 static int imap_remove_file (char *dir, int msgnum);
 static int imap_retrieve_file (const char *dir, const int msgnum, const char *mailbox, const char *context);
@@ -3511,6 +3512,7 @@
 	copy(frompath2, topath2);
 	ast_variables_destroy(var);
 }
+#endif
 
 /*! 
  * \brief Removes the voicemail sound and information file.
@@ -3537,7 +3539,6 @@
 	unlink(txt);
 	return ast_filedelete(file, NULL);
 }
-#endif
 
 /*!
  * \brief utility used by inchar(), for base_encode()
@@ -5205,6 +5206,19 @@
 		ast_log(AST_LOG_WARNING, "No format for saving voicemail?\n");
 leave_vm_out:
 	free_user(vmu);
+
+#ifdef IMAP_STORAGE
+	/* expunge message - use UID Expunge if supported on IMAP server*/
+	ast_debug(3, "*** Checking if we can expunge, expungeonhangup set to %d\n",expungeonhangup);
+	if (expungeonhangup == 1) {
+#ifdef HAVE_IMAP_TK2006
+		if (LEVELUIDPLUS (vms->mailstream)) {
+			mail_expunge_full(vms->mailstream,NIL,EX_UID);
+		} else 
+#endif
+			mail_expunge(vms->mailstream);
+	}
+#endif
 	
 	return res;
 }
@@ -6077,6 +6091,14 @@
 
 	manager_event(EVENT_FLAG_CALL, "MessageWaiting", "Mailbox: %s@%s\r\nWaiting: %d\r\nNew: %d\r\nOld: %d\r\n", vmu->mailbox, vmu->context, ast_app_has_voicemail(ext_context, NULL), newmsgs, oldmsgs);
 	run_externnotify(vmu->context, vmu->mailbox, flag);
+
+#ifdef IMAP_STORAGE
+	vm_delete(fn);  /* Delete the file, but not the IMAP message */
+	if (ast_test_flag(vmu, VM_DELETE))  { /* Delete the IMAP message if delete = yes */
+		vm_imap_delete(vms->curmsg, vmu);
+		vms->newmessages--;  /* Fix new message count */
+	}
+#endif
 
 	return 0;
 }




More information about the asterisk-commits mailing list