evolution-rss r372 - in trunk: . src
- From: lucilanga svn gnome org
- To: svn-commits-list gnome org
- Subject: evolution-rss r372 - in trunk: . src
- Date: Sun, 7 Sep 2008 16:32:12 +0000 (UTC)
Author: lucilanga
Date: Sun Sep 7 16:32:12 2008
New Revision: 372
URL: http://svn.gnome.org/viewvc/evolution-rss?rev=372&view=rev
Log:
2008-09-07 Lucian Langa <lucilanga gnome org>
* src/rss.c: include feed_is_new for
article checking too
* src/rss.c: feed_is_new()
fix for #550744 - prevent duplicate
feeds
* src/misc.c: get_server_from_uri()
sanitize input
* src/rss.c: org_gnome_cooly_format_rss
Modified:
trunk/ChangeLog
trunk/TODO
trunk/src/misc.c
trunk/src/rss.c
Modified: trunk/TODO
==============================================================================
--- trunk/TODO (original)
+++ trunk/TODO Sun Sep 7 16:32:12 2008
@@ -38,3 +38,4 @@
* provide predefined groups of feeds (OSS & co)
* evolution import rss add no. of retries
* fix images when replying
+ * free willy all instances of strextr
Modified: trunk/src/misc.c
==============================================================================
--- trunk/src/misc.c (original)
+++ trunk/src/misc.c Sun Sep 7 16:32:12 2008
@@ -48,6 +48,11 @@
strextr(gchar *text, gchar *substr)
{
g_return_val_if_fail( text != NULL, NULL);
+ if (substr == NULL)
+ return g_strdup(text);
+ //first check if string contains the substring
+ if (!strstr(text, substr))
+ return g_strdup(text);
char *tmp = g_strdup(text);
GString *str = g_string_new(NULL);
g_string_append(str, tmp);
Modified: trunk/src/rss.c
==============================================================================
--- trunk/src/rss.c (original)
+++ trunk/src/rss.c Sun Sep 7 16:32:12 2008
@@ -4244,14 +4244,19 @@
memset(rfeed, 0, 512);
FILE *fr = fopen(file_name, "r");
int occ = 0;
+ gchar *server = NULL;
+ server = get_server_from_uri(needle);
+ if (server == NULL)
+ server = get_url_basename(needle);
+ gchar *port = get_server_port(server);
//in case URI part contains this
- gchar *tmpneedle = strextr(needle, ":80");
+ gchar *tmpneedle = strextr(needle, port);
if (fr)
{
while (fgets(rfeed, 511, fr) != NULL)
{
- if (rfeed && strstr(rfeed, needle))
+ if (rfeed && strstr(rfeed, tmpneedle))
{
occ=1;
break;
@@ -4267,7 +4272,8 @@
fputs(needle, fw);
fclose(fw);
}
- }
+ }
+ g_free(tmpneedle);
return occ;
}
@@ -4674,6 +4680,8 @@
while (gtk_events_pending())
gtk_main_iteration ();
+ if (!feed_is_new(feed_name, feed)) {
+/*
if (fr)
{
while (fgets(rfeed, 511, fr) != NULL)
@@ -4691,7 +4699,7 @@
gtk_main_iteration ();
if (!occ)
- {
+ {*/
ftotal++;
p = decode_html_entities (p);
gchar *tmp = decode_utf8_entities(b);
@@ -4754,12 +4762,12 @@
}
else
{
- if (fw)
- {
- fputs(feed, fw);
+ //if (fw)
+ //{
+ // fputs(feed, fw);
//write(fw,feed, strlen(feed));
// fsync(fw);
- }
+ //}
create_mail(CF);
free_cf(CF);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]