Add option to enable or disable showing usernames in RSS items
[tweeper.git] / src / rss_converter_twitter.com.xsl
index 1d98fa2..b59a97b 100644 (file)
@@ -24,6 +24,7 @@
     exclude-result-prefixes="php">
 
     <xsl:param name="generate-enclosure"/>
+    <xsl:param name="show-usernames"/>
 
     <xsl:output method="xml" indent="yes"/>
 
         <xsl:variable name="item-has-gif" select="$item-media//*[contains(@class, 'PlayableMedia--gif')]"/>
         <item>
             <title>
-                <xsl:value-of select="concat($user-name, ': ')"/>
+                <xsl:if test="($show-usernames = 1) or ($screen-name != $user-name)">
+                    <xsl:value-of select="concat($user-name, ': ')"/>
+                </xsl:if>
                 <xsl:if test="$item-has-video">
                     <xsl:text>(Video) </xsl:text>
                 </xsl:if>
             </pubDate>
             <description>
                 <xsl:text disable-output-escaping="yes">&lt;![CDATA[</xsl:text>
-                <xsl:value-of select="concat($user-name, ':')"/>
-                <xsl:element name="br"/>
+                <xsl:if test="($show-usernames = 1) or ($screen-name != $user-name)">
+                    <xsl:value-of select="concat($user-name, ':')"/>
+                    <xsl:element name="br"/>
+                </xsl:if>
                 <xsl:if test="$item-has-video">
                     <xsl:text> (Video)</xsl:text>
                     <xsl:element name="br"/>