private void TryProcessGmLabels(string data) { // Fix by kirchik var match = Expressions.GMailLabelsRex.Match(data); if (match.Success) { _downloadProgress = _downloadProgress | MessageFetchMode.GMailLabels; } var labelsMatches = Expressions.GMailLabelSplitRex.Matches(match.Groups[1].Value); if (labelsMatches.Count == 0) { return; //.Success || labelsMatch.Groups.Count <= 1) return; } foreach (Match labelsMatch in labelsMatches) { Labels.AddRangeInternal( labelsMatch.Groups.Cast <Group>() .Skip(1) .Select(_ => (_.Value.StartsWith("&") ? ImapUTF7.Decode(_.Value) : _.Value).Replace("\"", ""))); } }
internal Folder(string path, IEnumerable <string> flags, ref Folder parent, ImapClient client) { _path = path; _name = ImapUTF7.Decode(_path.Split(client.Behavior.FolderDelimeter).Last()); UpdateFlags(flags); _parent = parent; _client = client; GMailThreads = new GMailThreadCollection(); }
private void TryProcessGmLabels(string data) { Match labelsMatch = Expressions.GMailLabelSplitRex.Match(Expressions.GMailLabelsRex.Match(data).Groups[1].Value); if (!labelsMatch.Success || labelsMatch.Groups.Count <= 1) { return; } Labels.AddRangeInternal( labelsMatch.Groups.Cast <Group>() .Skip(1) .Select(_ => (_.Value.StartsWith("&") ? ImapUTF7.Decode(_.Value) : _.Value).Replace("\"", ""))); _downloadProgress = _downloadProgress | MessageFetchMode.GMailLabels; }