|
|
@@ -28,6 +28,24 @@
|
|
|
Twitter feed for: ${desc}. Generated by ${cfg.hostname}
|
|
|
#end proc
|
|
|
#
|
|
|
+#proc getTweetsWithPinned(profile: Profile): seq[Tweets] =
|
|
|
+#result = profile.tweets.content
|
|
|
+#if profile.pinned.isSome and result.len > 0:
|
|
|
+# let pinnedTweet = profile.pinned.get
|
|
|
+# var inserted = false
|
|
|
+# for threadIdx in 0 ..< result.len:
|
|
|
+# if not inserted:
|
|
|
+# for tweetIdx in 0 ..< result[threadIdx].len:
|
|
|
+# if result[threadIdx][tweetIdx].id < pinnedTweet.id:
|
|
|
+# result[threadIdx].insert(pinnedTweet, tweetIdx)
|
|
|
+# inserted = true
|
|
|
+# end if
|
|
|
+# end for
|
|
|
+# end if
|
|
|
+# end for
|
|
|
+#end if
|
|
|
+#end proc
|
|
|
+#
|
|
|
#proc renderRssTweet(tweet: Tweet; cfg: Config): string =
|
|
|
#let tweet = tweet.retweet.get(tweet)
|
|
|
#let urlPrefix = getUrlPrefix(cfg)
|
|
|
@@ -106,8 +124,9 @@ Twitter feed for: ${desc}. Generated by ${cfg.hostname}
|
|
|
<width>128</width>
|
|
|
<height>128</height>
|
|
|
</image>
|
|
|
-#if profile.tweets.content.len > 0:
|
|
|
-${renderRssTweets(profile.tweets.content, cfg, userId=profile.user.id)}
|
|
|
+#let tweetsList = getTweetsWithPinned(profile)
|
|
|
+#if tweetsList.len > 0:
|
|
|
+${renderRssTweets(tweetsList, cfg, userId=profile.user.id)}
|
|
|
#end if
|
|
|
</channel>
|
|
|
</rss>
|