Gossamer Forum
Home : Products : Gossamer Mail : Discussion :

Re: [brewt] Cron Error - Could not DELE 1316

Quote Reply
Re: [brewt] Cron Error - Could not DELE 1316 In reply to
Thanks Adrian I'll give that a try.

There actually is a delete duplicates function already!!

It controls the deleting of duplicate emails from within the folders section on the users side.

This just needs to loop through the unique user id's and folder ids and should work... but I'm not sure how to do it (my perl is crap).

Not sure if that would be a quick one to figure out?

Regan




Code:
$COMPILE{delete_folder_duplicates} = __LINE__ . <<'END_OF_SUB';
sub delete_folder_duplicates {
# -------------------------------------------------------------------
# Takes the folder ID from folders_fid as cgi input and delete any
# messages that are duplicates. The folder ID can also be passed in
# as the first argument. If it is it will ignore CGI input.
#
my ($self, $fid) = @_;

$fid ||= $IN->param('folders_fid');
$fid or return $self->error('FOLDERR_NOID', 'WARN');
$fid =~ /^\d+$/ or return $self->error('FOLDERR_ID', 'WARN', $fid);

my $sth = $DB->table('msgs', 'msgtrack')->select(
'msgs_checksum', 'msgtrack_id',
{
msgtrack_userid => $USER->{userid},
msgtrack_fid => $fid,
}
);
my (%cache, @delete);
while (my ($checksum, $id) = $sth->fetchrow()) {
if (exists($cache{$checksum})) {
push @delete, $id;
}
else {
$cache{$checksum} = 1;
}
}
my $cnt = $PLG->dispatch('GMail::Messages::delete', sub { $self->delete(@_) }, $fid, @delete);
return { message => 'MSG_DEL' }, $cnt;
}
END_OF_SUB
Subject Author Views Date
Thread Cron Error - Could not DELE 1316 ryel01 6928 Feb 12, 2008, 1:41 PM
Thread Re: [ryel01] Cron Error - Could not DELE 1316
brewt 6815 Feb 12, 2008, 7:32 PM
Post Re: [brewt] Cron Error - Could not DELE 1316
ryel01 6821 Feb 12, 2008, 7:35 PM
Post Re: [brewt] Cron Error - Could not DELE 1316
ryel01 6792 Feb 12, 2008, 10:10 PM
Thread Re: [brewt] Cron Error - Could not DELE 1316
ryel01 6801 Feb 13, 2008, 11:24 AM
Thread Re: [ryel01] Cron Error - Could not DELE 1316
brewt 6790 Feb 13, 2008, 10:42 PM
Post Re: [brewt] Cron Error - Could not DELE 1316
ryel01 6766 Feb 13, 2008, 11:34 PM