File tree Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -543,7 +543,18 @@ async fn lookup_github_username(ctx: &Context, zulip_username: &str) -> anyhow::
543
543
}
544
544
} ;
545
545
546
- Ok ( format ! ( "{zulip_username}'s GitHub profile is [{github_username}](https://github.com/{github_username})." ) )
546
+ Ok ( format ! (
547
+ "{}'s GitHub profile is [{github_username}](https://github.com/{github_username})." ,
548
+ render_zulip_username( zulip_user. user_id)
549
+ ) )
550
+ }
551
+
552
+ fn render_zulip_username ( zulip_id : u64 ) -> String {
553
+ // Rendering the username directly was running into some encoding issues, so we use
554
+ // the special `|<user-id>` syntax instead.
555
+ // @**|<zulip-id>** is Zulip syntax that will render as the username (and a link) of the user
556
+ // with the given Zulip ID.
557
+ format ! ( "@**|{zulip_id}**" )
547
558
}
548
559
549
560
/// Tries to find a Zulip username from a GitHub username.
@@ -599,10 +610,9 @@ async fn lookup_zulip_username(ctx: &Context, gh_username: &str) -> anyhow::Resu
599
610
}
600
611
} ,
601
612
} ;
602
- // @**|<zulip-id>** is Zulip syntax that will render as the username (and a link) of the user
603
- // with the given Zulip ID.
604
613
Ok ( format ! (
605
- "The GitHub user `{gh_username}` has the following Zulip account: @**|{zulip_id}**"
614
+ "The GitHub user `{gh_username}` has the following Zulip account: {}" ,
615
+ render_zulip_username( zulip_id)
606
616
) )
607
617
}
608
618
You can’t perform that action at this time.
0 commit comments