From a93623618b83fb08f2a0a728800f431856b29f92 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Mon, 7 Feb 2011 16:33:36 -0600 Subject: [PATCH] 3 regresions from this now, rolling it back --- src/mod/applications/mod_voicemail/mod_voicemail.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/mod/applications/mod_voicemail/mod_voicemail.c b/src/mod/applications/mod_voicemail/mod_voicemail.c index bea82142b6..80b011e189 100644 --- a/src/mod/applications/mod_voicemail/mod_voicemail.c +++ b/src/mod/applications/mod_voicemail/mod_voicemail.c @@ -1277,13 +1277,9 @@ static void message_count(vm_profile_t *profile, const char *id_in, const char * myid = resolve_id(id_in, domain_name, "message-count"); - switch_snprintf(sql, sizeof(sql), "select 1, read_flags, count(read_epoch) from voicemail_msgs where " - "username='%s' and domain='%s' and in_folder='%s' " - "and read_epoch=0 group by read_flags union select 0, read_flags, count(read_epoch) from voicemail_msgs where username='%s' " - "and domain='%s' and in_folder='%s' and read_epoch<>0 group by read_flags;", - myid, domain_name, myfolder, myid, domain_name, myfolder); - - + switch_snprintf(sql, sizeof(sql), + "select read_epoch=0, read_flags, count(read_epoch) from voicemail_msgs where username='%s' and domain='%s' and in_folder='%s' group by read_epoch=0,read_flags;", + myid, domain_name, myfolder); vm_execute_sql_callback(profile, profile->mutex, sql, message_count_callback, &cbt);