diff options
| author | Megumi Sonoda <[email protected]> | 2018-02-23 17:49:59 -0700 |
|---|---|---|
| committer | Zeyla Hellyer <[email protected]> | 2018-02-23 16:49:59 -0800 |
| commit | 2ab714f9c3683db83eba1f6fe7bb3887a47d4f3f (patch) | |
| tree | 2e9c3935fe55c961fbfab39fcc4d6db996174b90 /src | |
| parent | Drop implementation for ffmpeg container (diff) | |
| download | serenity-2ab714f9c3683db83eba1f6fe7bb3887a47d4f3f.tar.xz serenity-2ab714f9c3683db83eba1f6fe7bb3887a47d4f3f.zip | |
Pad user discriminators in content_safe to 4 digits
This brings the function in line with the 'tag' function for User models,
and with the official Discord app experience and other libraries.
Diffstat (limited to 'src')
| -rw-r--r-- | src/model/channel/message.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/model/channel/message.rs b/src/model/channel/message.rs index feff845..eefb633 100644 --- a/src/model/channel/message.rs +++ b/src/model/channel/message.rs @@ -271,7 +271,7 @@ impl Message { at_distinct.push('@'); at_distinct.push_str(&u.name); at_distinct.push('#'); - let _ = write!(at_distinct, "{}", u.discriminator); + let _ = write!(at_distinct, "{:04}", u.discriminator); result = result.replace(&u.mention(), &at_distinct); } |