~ubuntu-branches/ubuntu/precise/evolution/precise

« back to all changes in this revision

Viewing changes to mail/mail-autofilter.c

  • Committer: Package Import Robot
  • Author(s): Mathieu Trudel-Lapierre
  • Date: 2011-09-08 09:38:57 UTC
  • mfrom: (1.1.84 upstream)
  • Revision ID: package-import@ubuntu.com-20110908093857-6lfl04ke2ns3kx2o
Tags: 3.1.91-0ubuntu1
* New upstream release. (LP: #843769)
* debian/control: bump e-d-s Build-Depends to 3.1.91. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
90
90
                        break;
91
91
                if ((s[0] == 'r' || s[0] == 'R')
92
92
                    && (s[1] == 'e' || s[1] == 'E')) {
93
 
                        p = s+2;
 
93
                        p = s + 2;
94
94
                        while (isdigit (*p) || (ispunct (*p) && (*p != ':')))
95
95
                                p++;
96
96
                        if (*p == ':') {
104
104
        return (gchar *) s;
105
105
}
106
106
 
107
 
#if 0
108
 
gint
109
 
reg_match (gchar *str, gchar *regstr)
110
 
{
111
 
        regex_t reg;
112
 
        gint error;
113
 
        gint ret;
114
 
 
115
 
        error = regcomp (&reg, regstr, REG_EXTENDED|REG_ICASE|REG_NOSUB);
116
 
        if (error != 0) {
117
 
                return 0;
118
 
        }
119
 
        error = regexec (&reg, str, 0, NULL, 0);
120
 
        regfree (&reg);
121
 
        return (error == 0);
122
 
}
123
 
#endif
124
 
 
125
107
static void
126
 
rule_add_subject (ERuleContext *context, EFilterRule *rule, const gchar *text)
 
108
rule_add_subject (ERuleContext *context,
 
109
                  EFilterRule *rule,
 
110
                  const gchar *text)
127
111
{
128
112
        EFilterPart *part;
129
113
        EFilterElement *element;
140
124
}
141
125
 
142
126
static void
143
 
rule_add_sender (ERuleContext *context, EFilterRule *rule, const gchar *text)
 
127
rule_add_sender (ERuleContext *context,
 
128
                 EFilterRule *rule,
 
129
                 const gchar *text)
144
130
{
145
131
        EFilterPart *part;
146
132
        EFilterElement *element;
157
143
}
158
144
 
159
145
/* do a bunch of things on the subject to try and detect mailing lists, remove
160
 
   unneeded stuff, etc */
 
146
 * unneeded stuff, etc */
161
147
static void
162
 
rule_match_subject (ERuleContext *context, EFilterRule *rule, const gchar *subject)
 
148
rule_match_subject (ERuleContext *context,
 
149
                    EFilterRule *rule,
 
150
                    const gchar *subject)
163
151
{
164
152
        const gchar *s;
165
153
        const gchar *s1, *s2;
186
174
        s1 = strchr (s, ':');
187
175
        if (s1) {
188
176
                tmp = g_alloca (s1 - s + 1);
189
 
                memcpy (tmp, s, s1-s);
 
177
                memcpy (tmp, s, s1 - s);
190
178
                tmp[s1 - s] = 0;
191
179
                g_strstrip (tmp);
192
180
                rule_add_subject (context, rule, tmp);
193
 
                s = s1+1;
 
181
                s = s1 + 1;
194
182
        }
195
183
 
196
184
        /* just lump the rest together */
201
189
}
202
190
 
203
191
static void
204
 
rule_match_mlist (ERuleContext *context, EFilterRule *rule, const gchar *mlist)
 
192
rule_match_mlist (ERuleContext *context,
 
193
                  EFilterRule *rule,
 
194
                  const gchar *mlist)
205
195
{
206
196
        EFilterPart *part;
207
197
        EFilterElement *element;