]> spindle.queued.net Git - midori/commitdiff
Thunderbird only accepts feed://, Liferea doesn't mind
authorChristian Dywan <christian@twotoasts.de>
Sun, 14 Aug 2011 23:13:09 +0000 (01:13 +0200)
committerChristian Dywan <christian@twotoasts.de>
Mon, 15 Aug 2011 19:30:22 +0000 (21:30 +0200)
https://bugs.launchpad.net/midori/+bug/826444

midori/midori-browser.c

index 6b84abd8374db37b1ee8758dfcd1ca4d72ac1acb..f116863ca01922cd1c4789f4dcaddd45817ce951 100644 (file)
@@ -2347,12 +2347,22 @@ midori_browser_subscribe_to_news_feed (MidoriBrowser* browser,
 {
     if (browser->news_aggregator && *browser->news_aggregator)
     {
+        /* Thunderbird only accepts feed://, Liferea doesn't mind */
+        gchar* feed = g_strdup (uri);
+        if (g_str_has_prefix (feed, "http://"))
+        {
+            feed[0] = 'f';
+            feed[1] = 'e';
+            feed[2] = 'e';
+            feed[3] = 'd';
+        }
         /* Special-case Liferea because a helper script may be required */
         if (g_str_equal (browser->news_aggregator, "liferea")
          && g_find_program_in_path ("liferea-add-feed"))
-            sokoke_spawn_program ("liferea-add-feed", uri);
+            sokoke_spawn_program ("liferea-add-feed", feed);
         else
-            sokoke_spawn_program (browser->news_aggregator, uri);
+            sokoke_spawn_program (browser->news_aggregator, feed);
+        g_free (feed);
     }
     else
     {