Skip to content

Commit

Permalink
Fix atom feed subscription
Browse files Browse the repository at this point in the history
Save config when newly created feed selected
  • Loading branch information
ThosRTanner committed Jul 20, 2019
1 parent 1415fa3 commit eb87b9c
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 6 deletions.
5 changes: 5 additions & 0 deletions Changes.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Changes for v 2.2.0.4

Fixed issue with config not being saved when you selected a new feed from the dialogue box
Fixed issue with not being able to subscribe to palemoon atom feed

# Changes for v 2.2.0.3

Fixed registration of video and audio podcast handlers on basilisk (and firefox)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -731,7 +731,7 @@ Feed_Manager.prototype = {
//what I want to do here
/* jshint ignore:start */
//eslint-disable-next-line no-new
new Added_New_Feed_Dialogue(this._document, elem, this);
new Added_New_Feed_Dialogue(this._document, this._config, elem, this);
/* jshint ignore:end */
}
catch (err)
Expand Down
2 changes: 1 addition & 1 deletion source/content/inforss/mediator/inforss_Mediator.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ Mediator.prototype = {
},

//----------------------------------------------------------------------------
//Only used from main code currently
//Only used from main code and added new feed dialogue currently
setSelected(url)
{
try
Expand Down
5 changes: 4 additions & 1 deletion source/content/inforss/modules/inforss_Feed_Parser.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,11 @@ function getHref(obj)
{
//FIXME Wouldn't this be better coded as doc.querySelector(rel == alternate
//&& type == link) on the whole objdoc?
//FIXME I'm not sure if this is correct.
for (let elem of obj)
{
if (elem.getAttribute("rel") == "alternate")
const attr = elem.getAttribute("rel");
if (attr == "self" || attr == "alternate")
{
return elem.getAttribute("href");
}
Expand Down Expand Up @@ -187,6 +189,7 @@ Feed_Parser.prototype = {
const str_description = atom_feed ? "tagline" : "entry";
const str_item = atom_feed ? "entry" : "item";

//This should probably only be links at the top level for atom feeds.
this.link = atom_feed ?
getHref(objDoc.getElementsByTagName("link")) :
getNodeValue(objDoc.getElementsByTagName("link"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,15 @@ const {
* as the current feed
*
* @param {Document} document - the current world
* @param {Config} config - the current configuration
* @param {Object} feed - new feed configuration
* @param {Feed_Manager} feed_manager - owner of me.
*/
function Added_New_Feed_Dialogue(document, feed, feed_manager)
function Added_New_Feed_Dialogue(document, config, feed, feed_manager)
{
this._feed_manager = feed_manager;
this._config = config;
this._feed = feed;
this._feed_manager = feed_manager;
this._dialogue = document.defaultView.open(
"chrome://inforss/content/windows/inforss_Added_New_Feed_Dialogue.xul",
"_blank",
Expand Down Expand Up @@ -139,6 +141,7 @@ Added_New_Feed_Dialogue.prototype = {
_on_dialogue_accept(/*event*/)
{
this._feed_manager.setSelected(this._feed.getAttribute("url"));
this._config.save();
},

/** Window closing. Remove all event listeners
Expand Down
2 changes: 1 addition & 1 deletion source/install.rdf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<em:id>[email protected]</em:id>
<em:type>2</em:type>
<em:unpack>true</em:unpack>
<em:version>2.2.0.3</em:version>
<em:version>2.2.0.4</em:version>
<em:name>infoRSS Reloaded</em:name>
<em:description>Display NNTP, HTML, RSS and Atom headlines in the status bar</em:description>
<em:creator>Didier Ernotte</em:creator>
Expand Down

0 comments on commit eb87b9c

Please sign in to comment.