diff options
author | Guilhem Moulin <guilhem@fripost.org> | 2015-07-23 15:46:45 +0200 |
---|---|---|
committer | Guilhem Moulin <guilhem@fripost.org> | 2015-07-23 17:15:38 +0200 |
commit | 71edd6346a069740661789a8ebdb6f34fda7a966 (patch) | |
tree | 8fdf726c3530044f3c9152dc98fe5fe560061a3f /imapsync | |
parent | 52cae29b54ee34f164cbda627a1758931970f1b1 (diff) |
Mark mailboxes as (un)subscribed in the DB.
Diffstat (limited to 'imapsync')
-rwxr-xr-x | imapsync | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -444,6 +444,20 @@ my @SUBSCRIPTIONS; push @{$IMAP->{$unsubscribed}->{mailboxes}->{$mbx}}, '\Subscribed'; } } + else { + $sth_search->execute($mbx); + my $row = $sth_search->fetch(); + die if defined $sth_search->fetch(); # sanity check + + if (defined $row) { + my ($idx,$status) = @$row; + unless (defined $status and $status != 0) { + my $subscribed = subscribed_mbx('local',$mbx) ? 1 : 0; + $sth_subscribe->execute($subscribed, $idx); + $DBH->commit(); + } + } + } push @SUBSCRIPTIONS, $mbx if subscribed_mbx('local', $mbx) and subscribed_mbx('remote',$mbx); } |