[blam/wcf: 4/8] Make use of <content:encoded> if available
- From: Carlos Martín Nieto <cmartin src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [blam/wcf: 4/8] Make use of <content:encoded> if available
- Date: Mon, 6 Sep 2010 17:52:11 +0000 (UTC)
commit f71ffffdbb95603cb4a46dda41b5254bc82afe94
Author: Carlos MartÃn Nieto <carlos cmartin tk>
Date: Sun Jun 6 20:31:16 2010 +0200
Make use of <content:encoded> if available
src/Item.cs | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/src/Item.cs b/src/Item.cs
index a158ddd..fc8ece4 100644
--- a/src/Item.cs
+++ b/src/Item.cs
@@ -53,7 +53,7 @@ namespace Imendio.Blam {
this.Title = HtmlUtils.StripHtml(item.Title.Text.Trim());
}
- if(item.Summary.Text != ""){
+ if(item.Summary.Text != null && item.Summary.Text != ""){
this.Text = item.Summary.Text.Trim();
}
@@ -61,6 +61,13 @@ namespace Imendio.Blam {
this.Text = (item.Content as TextSyndicationContent).Text;
}
+ /* Get <content:encoded> elements, overwriting <content> */
+ foreach(SyndicationElementExtension ext in item.ElementExtensions){
+ if(ext.OuterName == "encoded"){
+ this.Text = ext.GetObject<string>();
+ }
+ }
+
/* FIXME: Actually search for the "self" link */
if(item.Links[0].Uri.ToString() != ""){
this.Link = item.Links[0].Uri.ToString();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]