Skip to content

Commit

Permalink
fix attempt
Browse files Browse the repository at this point in the history
Github-ref: OfflineIMAP#545
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
  • Loading branch information
nicolas33 committed May 7, 2018
1 parent 89b40ec commit 33cd887
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion offlineimap/folder/Gmail.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ def cachemessagelist(self, min_date=None, min_uid=None):
if messagestr == None:
continue
messagestr = messagestr.split(' ', 1)[1]
# e.g.: {'X-GM-LABELS': '("Webserver (RW.net)" "\\Inbox" GInbox)', 'FLAGS': '(\\Seen)', 'UID': '275440'}
options = imaputil.flags2hash(messagestr)
if not 'UID' in options:
self.ui.warn('No UID in message with options %s' %\
Expand All @@ -162,7 +163,8 @@ def cachemessagelist(self, min_date=None, min_uid=None):
uid = int(options['UID'])
self.messagelist[uid] = self.msglist_item_initializer(uid)
flags = imaputil.flagsimap2maildir(options['FLAGS'])
m = re.search('\(([^\)]*)\)', options['X-GM-LABELS'])
# e.g.: '("Webserver (RW.net)" "\\Inbox" GInbox)'
m = re.search('^[(](.*)[)]', options['X-GM-LABELS'])
if m:
labels = set([imaputil.dequote(lb) for lb in imaputil.imapsplit(m.group(1))])
else:
Expand Down
2 changes: 1 addition & 1 deletion offlineimap/imaputil.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def __debug(*args):
msg = []
for arg in args:
msg.append(str(arg))
getglobalui().debug('imap', " ".join(msg))
# getglobalui().debug('imap', " ".join(msg))

def dequote(s):
"""Takes string which may or may not be quoted and unquotes it.
Expand Down

0 comments on commit 33cd887

Please sign in to comment.