Skip to content

Commit

Permalink
Fix a bug where messages weren't being moved because the connection w…
Browse files Browse the repository at this point in the history
…as using sequence ids, rather than unique ids.
  • Loading branch information
Thomi Richards committed Jun 14, 2015
1 parent dfc771e commit 4953a23
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion gmailfilter/_connection.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from contextlib import contextmanager
import configparser
import functools
import logging
import os
import os.path
Expand Down Expand Up @@ -270,7 +271,18 @@ def __getattribute__(self, name):
'set_gmail_labels',
)
if name in allowed:
return getattr(self._wrapped, name)
# Wrap these functions so they always use the uid, not the sequence
# id.
function = getattr(self._wrapped, name)
def wrapper(client, fn, *args, **kwargs):
old = client.use_uid
client.use_uid = True
try:
return fn(*args, **kwargs)
finally:
client.use_uid = old
return functools.partial(wrapper, self._wrapped, function)

raise AttributeError(name)


Expand Down

0 comments on commit 4953a23

Please sign in to comment.