File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -122,10 +122,17 @@ public override string Shortlink
122
122
{
123
123
get
124
124
{
125
- // Not really a "short" link, but you can't actually use short links for comments
125
+ // Not really a "short" link, but you can't actually use short links for comments
126
+ string linkId = "" ;
127
+ int index = this . LinkId . IndexOf ( '_' ) ;
128
+ if ( index > - 1 )
129
+ {
130
+ linkId = this . LinkId . Substring ( index + 1 ) ;
131
+ }
132
+
126
133
return String . Format ( "{0}://{1}/r/{2}/comments/{3}/_/{4}" ,
127
- RedditSharp . WebAgent . Protocol , RedditSharp . WebAgent . RootDomain ,
128
- this . Subreddit , this . Parent . Id , this . Id ) ;
134
+ RedditSharp . WebAgent . Protocol , RedditSharp . WebAgent . RootDomain ,
135
+ this . Subreddit , this . Parent != null ? this . Parent . Id : linkId , this . Id ) ;
129
136
}
130
137
}
131
138
You can’t perform that action at this time.
0 commit comments